-
Notifications
You must be signed in to change notification settings - Fork 40
CI rework #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tarcila
wants to merge
1
commit into
NVIDIA:next_release
Choose a base branch
from
tarcila:ci-update
base: next_release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CI rework #217
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: 'Build ANARI-SDK' | ||
| description: 'Build and cache ANARI-SDK dependency' | ||
| inputs: | ||
| config: | ||
| description: 'Build configuration (Release, Debug, etc.)' | ||
| required: true | ||
| install-prefix: | ||
| description: 'Installation prefix for ANARI-SDK' | ||
| required: true | ||
| build-deps-path: | ||
| description: 'Path to the build_deps directory containing CMakeLists.txt' | ||
| required: false | ||
| default: 'tsd/cmake/build_deps' | ||
| generator: | ||
| description: 'CMake generator to use' | ||
| required: false | ||
| default: '' | ||
| outputs: | ||
| cache-hit: | ||
| description: 'Whether the cache was hit' | ||
| value: ${{ steps.cache-anari.outputs.cache-hit }} | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Cache ANARI-SDK | ||
| uses: actions/cache@v4 | ||
| id: cache-anari | ||
| with: | ||
| path: ${{ inputs.install-prefix }} | ||
| key: anari-sdk-${{ runner.os }}-${{ inputs.config }}-${{ inputs.generator || 'default' }}-${{ hashFiles('**/build_deps/CMakeLists.txt', '**/build_deps/superbuild_macros.cmake') }} | ||
|
|
||
| - name: Configure ANARI-SDK CMake (with generator) | ||
| if: steps.cache-anari.outputs.cache-hit != 'true' && inputs.generator != '' | ||
| shell: bash | ||
| run: | | ||
| cmake -LA -G "${{ inputs.generator }}" -B "${{ github.workspace }}/anari_deps_build" \ | ||
| -DCMAKE_BUILD_TYPE=${{ inputs.config }} \ | ||
| -DCMAKE_INSTALL_PREFIX="${{ inputs.install-prefix }}" \ | ||
| "${{ github.workspace }}/${{ inputs.build-deps-path }}" | ||
|
|
||
| - name: Configure ANARI-SDK CMake (default generator) | ||
| if: steps.cache-anari.outputs.cache-hit != 'true' && inputs.generator == '' | ||
| shell: bash | ||
| run: | | ||
| cmake -LA -B "${{ github.workspace }}/anari_deps_build" \ | ||
| -DCMAKE_BUILD_TYPE=${{ inputs.config }} \ | ||
| -DCMAKE_INSTALL_PREFIX="${{ inputs.install-prefix }}" \ | ||
| "${{ github.workspace }}/${{ inputs.build-deps-path }}" | ||
|
|
||
| - name: Build + install ANARI-SDK | ||
| if: steps.cache-anari.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: cmake --build "${{ github.workspace }}/anari_deps_build" --config ${{ inputs.config }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| name: 'Setup CUDA Toolkit' | ||
| description: 'Install CUDA toolkit using redistributable archives with checksum verification and caching' | ||
| inputs: | ||
| cuda-version: | ||
| description: 'CUDA version to install (e.g., 12.4.1, 13.0.2)' | ||
| required: true | ||
| outputs: | ||
| cuda-path: | ||
| description: 'Path to CUDA installation' | ||
| value: ${{ steps.set-env.outputs.cuda-path }} | ||
| cache-hit: | ||
| description: 'Whether cache was hit' | ||
| value: ${{ steps.cache-cuda.outputs.cache-hit }} | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| # Parse version components | ||
| - name: Parse CUDA version | ||
| id: parse-version | ||
| shell: bash | ||
| run: | | ||
| CUDA_VERSION="${{ inputs.cuda-version }}" | ||
| CUDA_MAJOR=$(echo $CUDA_VERSION | cut -d. -f1) | ||
| CUDA_MINOR=$(echo $CUDA_VERSION | cut -d. -f2) | ||
| CUDA_PATCH=$(echo $CUDA_VERSION | cut -d. -f3) | ||
| echo "major=$CUDA_MAJOR" >> $GITHUB_OUTPUT | ||
| echo "minor=$CUDA_MINOR" >> $GITHUB_OUTPUT | ||
| echo "patch=$CUDA_PATCH" >> $GITHUB_OUTPUT | ||
| echo "major-minor=${CUDA_MAJOR}.${CUDA_MINOR}" >> $GITHUB_OUTPUT | ||
|
|
||
| # Cache the CUDA installation | ||
| # Install directly to cache directory - no sudo needed | ||
| - name: Cache CUDA installation (Linux) | ||
| if: runner.os == 'Linux' | ||
| uses: actions/cache@v4 | ||
| id: cache-cuda-linux | ||
| with: | ||
| path: ~/cuda-${{ steps.parse-version.outputs.major-minor }} | ||
| key: cuda-Linux-${{ inputs.cuda-version }}-redist-v4 | ||
|
|
||
| - name: Cache CUDA installation (Windows) | ||
| if: runner.os == 'Windows' | ||
| uses: actions/cache@v4 | ||
| id: cache-cuda-windows | ||
| with: | ||
| path: C:\cuda-${{ steps.parse-version.outputs.major-minor }} | ||
| key: cuda-Windows-${{ inputs.cuda-version }}-redist-v2 | ||
|
|
||
| # Set cache-hit output for use in conditions | ||
| - name: Set cache status | ||
| id: cache-cuda | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ runner.os }}" == "Linux" ]; then | ||
| echo "cache-hit=${{ steps.cache-cuda-linux.outputs.cache-hit }}" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "cache-hit=${{ steps.cache-cuda-windows.outputs.cache-hit }}" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| # Linux installation via redistributables (cache miss) | ||
| - name: Install CUDA (Linux) | ||
| if: runner.os == 'Linux' && steps.cache-cuda-linux.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: | | ||
| CUDA_VERSION="${{ inputs.cuda-version }}" | ||
| CUDA_MAJOR_MINOR="${{ steps.parse-version.outputs.major-minor }}" | ||
| INSTALL_DIR="$HOME/cuda-${CUDA_MAJOR_MINOR}" | ||
| ACTION_DIR="${{ github.action_path }}" | ||
|
|
||
| echo "Installing CUDA $CUDA_VERSION using redistributables" | ||
|
|
||
| # Make install script executable and run it | ||
| chmod +x "$ACTION_DIR/scripts/install-cuda.sh" | ||
| "$ACTION_DIR/scripts/install-cuda.sh" \ | ||
| -v "$CUDA_VERSION" \ | ||
| -p "$INSTALL_DIR" \ | ||
| -c "$ACTION_DIR/components.json" | ||
|
|
||
| # Windows installation via redistributables (cache miss) | ||
| - name: Install CUDA (Windows) | ||
| if: runner.os == 'Windows' && steps.cache-cuda-windows.outputs.cache-hit != 'true' | ||
| shell: pwsh | ||
| run: | | ||
| $cudaVersion = "${{ inputs.cuda-version }}" | ||
| $cudaMajorMinor = "${{ steps.parse-version.outputs.major-minor }}" | ||
| $installPath = "C:\cuda-$cudaMajorMinor" | ||
| $actionDir = "${{ github.action_path }}" | ||
|
|
||
| Write-Host "Installing CUDA $cudaVersion using redistributables" | ||
|
|
||
| & "$actionDir\scripts\install-cuda.ps1" ` | ||
| -CudaVersion $cudaVersion ` | ||
| -InstallPath $installPath ` | ||
| -ComponentsFile "$actionDir\components.json" | ||
|
|
||
| # Set environment variables | ||
| - name: Set CUDA environment | ||
| id: set-env | ||
| shell: bash | ||
| run: | | ||
| CUDA_MAJOR_MINOR="${{ steps.parse-version.outputs.major-minor }}" | ||
|
|
||
| if [ "${{ runner.os }}" == "Linux" ]; then | ||
| CUDA_PATH="$HOME/cuda-${CUDA_MAJOR_MINOR}" | ||
| echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV | ||
| echo "${CUDA_PATH}/bin" >> $GITHUB_PATH | ||
| echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib64:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV | ||
| else | ||
| CUDA_PATH="C:\\cuda-${CUDA_MAJOR_MINOR}" | ||
| echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV | ||
| echo "${CUDA_PATH}\\bin" >> $GITHUB_PATH | ||
| # Required for CMake to find CUDA on Windows with Visual Studio | ||
| echo "CUDA_TOOLKIT_ROOT_DIR=${CUDA_PATH}" >> $GITHUB_ENV | ||
| echo "CudaToolkitDir=${CUDA_PATH}" >> $GITHUB_ENV | ||
| # CUDACXX tells CMake which CUDA compiler to use, bypassing VS toolset detection | ||
| echo "CUDACXX=${CUDA_PATH}\\bin\\nvcc.exe" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| echo "cuda-path=${CUDA_PATH}" >> $GITHUB_OUTPUT | ||
| echo "CUDA environment configured: ${CUDA_PATH}" | ||
|
|
||
| # Verify installation | ||
| - name: Verify CUDA installation | ||
| shell: bash | ||
| run: | | ||
| echo "Verifying CUDA installation..." | ||
| if command -v nvcc &> /dev/null; then | ||
| nvcc --version | ||
| else | ||
| echo "Warning: nvcc not found in PATH, but installation may still be valid" | ||
| echo "CUDA_PATH: $CUDA_PATH" | ||
| ls -la "$CUDA_PATH/bin" 2>/dev/null || dir "$CUDA_PATH\\bin" 2>/dev/null || true | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| { | ||
| "components": { | ||
| "cuda_nvcc": { | ||
| "required": true, | ||
| "description": "NVIDIA CUDA Compiler", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ] | ||
| }, | ||
| "cuda_cudart": { | ||
| "required": true, | ||
| "description": "CUDA Runtime", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ] | ||
| }, | ||
| "cuda_crt": { | ||
| "required": false, | ||
| "description": "C Runtime headers - only in CUDA 13+, bundled in cuda_cudart for 12.x", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ], | ||
| "min_version": "13.0.0" | ||
| }, | ||
| "libnvvm": { | ||
| "required": false, | ||
| "description": "NVVM library (cicc compiler) - only in CUDA 13+, bundled in cuda_nvcc for 12.x", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ], | ||
| "min_version": "13.0.0" | ||
| }, | ||
| "cuda_cccl": { | ||
| "required": true, | ||
| "description": "CUDA C++ Core Libraries (Thrust/CUB/libcudacxx)", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ] | ||
| }, | ||
| "cuda_nvml_dev": { | ||
| "required": true, | ||
| "description": "NVML development headers", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ] | ||
| }, | ||
| "libcurand": { | ||
| "required": true, | ||
| "description": "Random number generation library", | ||
| "platforms": [ | ||
| "linux-x86_64", | ||
| "windows-x86_64" | ||
| ] | ||
| }, | ||
| "visual_studio_integration": { | ||
| "required": true, | ||
| "description": "Visual Studio build integration (MSBuild rules)", | ||
| "platforms": [ | ||
| "windows-x86_64" | ||
| ] | ||
| } | ||
| }, | ||
| "supported_versions": [ | ||
| "12.4.1", | ||
| "13.0.2" | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache key version suffix 'v4' for Linux differs from 'v2' for Windows (line 47). This inconsistency could lead to confusion. Consider synchronizing version numbers or documenting why they differ.