@@ -9,15 +9,22 @@ inputs:
9
9
cuda-version :
10
10
required : true
11
11
type : string
12
+ cuda-components :
13
+ description : " A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'"
14
+ required : false
15
+ type : string
16
+ default : " cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_sanitizer_api,libnvjitlink"
12
17
13
18
runs :
14
19
using : composite
15
20
steps :
16
21
- name : Set up CTK cache variable
17
22
shell : bash --noprofile --norc -xeuo pipefail {0}
18
23
run : |
19
- echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}" >> $GITHUB_ENV
20
- echo "CTK_CACHE_FILENAME=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}.tar.gz" >> $GITHUB_ENV
24
+ HASH=$(echo -n "${{ inputs.cuda-components }}" | sha256sum | awk '{print $1}')
25
+ echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV
26
+ echo "CTK_CACHE_FILENAME=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH.tar.gz" >> $GITHUB_ENV
27
+ echo "CTK_CACHE_COMPONENTS=${{ inputs.cuda-components }}" >> $GITHUB_ENV
21
28
22
29
- name : Install dependencies
23
30
uses : ./.github/actions/install_unix_deps
@@ -78,19 +85,16 @@ runs:
78
85
rm $CTK_COMPONENT_COMPONENT_FILENAME
79
86
}
80
87
81
- # Get headers and shared libraries in place
82
- # Note: the existing artifact would need to be manually deleted (ex: through web UI)
83
- # if this list is changed, as the artifact actions do not offer any option for us to
84
- # invalidate the artifact.
85
- populate_cuda_path cuda_nvcc
86
- populate_cuda_path cuda_cudart
87
- populate_cuda_path cuda_nvrtc
88
- populate_cuda_path cuda_profiler_api
89
- populate_cuda_path cuda_cccl
90
- populate_cuda_path cuda_sanitizer_api
91
- if [[ "$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})" -ge 12 ]]; then
92
- populate_cuda_path libnvjitlink
88
+ # Conditionally strip out libnvjitlink for CUDA versions < 12
89
+ if [[ "$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})" -lt 12 ]]; then
90
+ CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libnvjitlink/}"
93
91
fi
92
+ # Cleanup stray commas after removing components
93
+ CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//,,/,}"
94
+ # Get headers and shared libraries in place
95
+ for item in $(echo $CTK_CACHE_COMPONENTS | tr ',' ' '); do
96
+ populate_cuda_path "$item"
97
+ done
94
98
ls -l $CUDA_PATH
95
99
96
100
# Prepare the cache
0 commit comments