1111 cuda-version :
1212 required : true
1313 type : string
14+ prev-cuda-version :
15+ required : true
16+ type : string
1417
1518defaults :
1619 run :
@@ -109,45 +112,68 @@ jobs:
109112 path : cuda_pathfinder/*.whl
110113 if-no-files-found : error
111114
115+ - name : Set up mini CTK
116+ uses : ./.github/actions/fetch_ctk
117+ continue-on-error : false
118+ with :
119+ host-platform : ${{ inputs.host-platform }}
120+ cuda-version : ${{ inputs.cuda-version }}
121+
122+ # TODO: this currently builds against the public cuda.bindings wheel. Consider
123+ # building against the wheel from main instead (the below step).
112124 - name : Build cuda.core wheel
113125 uses : pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
114126 with :
115127 package-dir : ./cuda_core/
116128 output-dir : ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
117-
118- - name : List the cuda.core artifacts directory
129+ env :
130+ CIBW_BUILD : ${{ env.CIBW_BUILD }}
131+ CIBW_ENVIRONMENT : >
132+ CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }}
133+ # CIBW mounts the host filesystem under /host
134+ CIBW_ENVIRONMENT_LINUX : >
135+ CUDA_PATH=/host/${{ env.CUDA_PATH }}
136+ CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
137+ CIBW_ENVIRONMENT_WINDOWS : >
138+ CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
139+ CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
140+
141+ - name : List the cuda.core artifacts directory and rename
119142 run : |
120143 if [[ "${{ inputs.host-platform }}" == win* ]]; then
121144 export CHOWN=chown
122145 else
123146 export CHOWN="sudo chown"
124147 fi
125148 $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
126- ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
127-
128- - name : Check cuda.core wheel
129- run : |
130- twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
131149
132- - name : Upload cuda.core build artifacts
133- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
134- with :
135- name : ${{ env.CUDA_CORE_ARTIFACT_NAME }}
136- path : ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
137- if-no-files-found : error
150+ # Rename wheel to include CUDA version suffix
151+ mkdir -p "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_CUDA_MAJOR}"
152+ for wheel in ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl; do
153+ if [[ -f "${wheel}" ]]; then
154+ base_name=$(basename "${wheel}" .whl)
155+ new_name="${base_name}.cu${BUILD_CUDA_MAJOR}.whl"
156+ mv "${wheel}" "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_CUDA_MAJOR}/${new_name}"
157+ echo "Renamed wheel to: ${new_name}"
158+ fi
159+ done
138160
139- - name : Set up mini CTK
140- uses : ./.github/actions/fetch_ctk
141- continue-on-error : false
142- with :
143- host-platform : ${{ inputs.host-platform }}
144- cuda-version : ${{ inputs.cuda-version }}
161+ ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
145162
146163 - name : Build cuda.bindings wheel
147164 uses : pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
148165 with :
149166 package-dir : ./cuda_bindings/
150167 output-dir : ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
168+ env :
169+ CIBW_BUILD : ${{ env.CIBW_BUILD }}
170+ # CIBW mounts the host filesystem under /host
171+ CIBW_ENVIRONMENT_LINUX : >
172+ CUDA_PATH=/host/${{ env.CUDA_PATH }}
173+ CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
174+ CIBW_ENVIRONMENT_WINDOWS : >
175+ CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
176+ CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
151177
152178 - name : List the cuda.bindings artifacts directory
153179 run : |
@@ -241,7 +267,7 @@ jobs:
241267
242268 - name : Build cuda.core Cython tests
243269 run : |
244- pip install $(ls ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl)[test]
270+ pip install $(ls ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/"cu${BUILD_CUDA_MAJOR}"/ *.whl)[test]
245271 pushd ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
246272 bash build_tests.sh
247273 popd
@@ -252,3 +278,73 @@ jobs:
252278 name : ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
253279 path : ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }}
254280 if-no-files-found : error
281+
282+ # Note: This overwrites CUDA_PATH etc
283+ - name : Set up mini CTK
284+ uses : ./.github/actions/fetch_ctk
285+ continue-on-error : false
286+ with :
287+ host-platform : ${{ inputs.host-platform }}
288+ cuda-version : ${{ inputs.prev-cuda-version }}
289+ cuda-path : " ./cuda_toolkit_prev"
290+
291+ # TODO: this currently builds against the public cuda.bindings wheel. Consider
292+ # building against the wheel from the backport branch instead.
293+ - name : Build cuda.core wheel
294+ uses : pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
295+ with :
296+ package-dir : ./cuda_core/
297+ output-dir : ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
298+ env :
299+ CIBW_BUILD : ${{ env.CIBW_BUILD }}
300+ CIBW_ENVIRONMENT : >
301+ CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }}
302+ # CIBW mounts the host filesystem under /host
303+ CIBW_ENVIRONMENT_LINUX : >
304+ CUDA_PATH=/host/${{ env.CUDA_PATH }}
305+ CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
306+ CIBW_ENVIRONMENT_WINDOWS : >
307+ CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
308+ CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
309+
310+ - name : List the cuda.core artifacts directory and rename
311+ run : |
312+ if [[ "${{ inputs.host-platform }}" == win* ]]; then
313+ export CHOWN=chown
314+ else
315+ export CHOWN="sudo chown"
316+ fi
317+ $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
318+ ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
319+
320+ # Rename wheel to include CUDA version suffix
321+ mkdir -p "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_PREV_CUDA_MAJOR}"
322+ for wheel in ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl; do
323+ if [[ -f "${wheel}" ]]; then
324+ base_name=$(basename "${wheel}" .whl)
325+ new_name="${base_name}.cu${BUILD_PREV_CUDA_MAJOR}.whl"
326+ mv "${wheel}" "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_PREV_CUDA_MAJOR}/${new_name}"
327+ echo "Renamed wheel to: ${new_name}"
328+ fi
329+ done
330+
331+ ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
332+
333+ - name : Merge cuda.core wheels
334+ run : |
335+ pip install wheel
336+ python ci/tools/merge_cuda_core_wheels.py \
337+ "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_CUDA_MAJOR}"/cuda_core*.whl \
338+ "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_PREV_CUDA_MAJOR}"/cuda_core*.whl \
339+ --output-dir "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"
340+
341+ - name : Check cuda.core wheel
342+ run : |
343+ twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
344+
345+ - name : Upload cuda.core build artifacts
346+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
347+ with :
348+ name : ${{ env.CUDA_CORE_ARTIFACT_NAME }}
349+ path : ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
350+ if-no-files-found : error
0 commit comments