Skip to content

Commit df5cd00

Browse files
authored
enforce a floor on libnvjitlink, build wheels with CUDA 13.0.x, test wheels against mix of CTK versions (#1862)
The changes from #1405 introduced linking against nvJitLink. nvJitLink has versioned symbols that are added in each new CTK release, and some of those are exposed in `libcuvs.so`. `libcuvs` wheels are built against the latest CTK supported in RAPIDS (CUDA 13.1.1 as of this writing), so when those wheels are used in environments with older nvJitLink, runtime errors like this can happen: > libcugraph.so: undefined symbol: __nvJitLinkGetErrorLog_13_1, version libnvJitLink.so.13 For more details, see rapidsai/cugraph#5443 This tries to fix that. Contributes to rapidsai/build-planning#257 * builds CUDA 13 wheels with the 13.0 CTK * ensures CUDA 13 wheels ship with a runtime dependency of `nvidia-nvjitlink>={whatever-minor-version-they-were-built-against}` Contributes to rapidsai/build-planning#256 * updates wheel tests to cover a range of CTK versions (we previously, accidentally, were only testing the latest 12.x and 13.x) Other changes * ensures conda packages also take on floors of `libnvjitlink>={whatever-minor-version-they-were-built-against}` ## Notes for Reviewers ### How I tested this This uses wheels from similar PRs from RAPIDS dependencies, at build and test time: * NVIDIA/raft#2971 * rapidsai/rmm#2270 * rapidsai/ucxx#604 ### Other Options 1. avoiding those versioned symbols with a build-time shim (#1855 does this, but hasn't been successful yet) 2. statically linking libnvJitLink (hasn't been successful yet) Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Gil Forsyth (https://github.com/gforsyth) URL: #1862
1 parent 70dc032 commit df5cd00

4 files changed

Lines changed: 82 additions & 34 deletions

File tree

ci/test_wheel_cuvs.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
1313
LIBCUVS_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuvs_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
1414
CUVS_WHEELHOUSE=$(rapids-download-from-github "$(rapids-package-name "wheel_python" cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")")
1515

16-
# echo to expand wildcard before adding `[extra]` requires for pip
16+
# generate constraints (possibly pinning to oldest support versions of dependencies)
17+
rapids-generate-pip-constraints test_python "${PIP_CONSTRAINT}"
18+
19+
# notes:
20+
#
21+
# * echo to expand wildcard before adding `[test]` requires for pip
22+
# * just providing --constraint="${PIP_CONSTRAINT}" to be explicit, and because
23+
# that environment variable is ignored if any other --constraint are passed via the CLI
24+
#
1725
rapids-pip-retry install \
26+
--prefer-binary \
27+
--constraint "${PIP_CONSTRAINT}" \
1828
"${LIBCUVS_WHEELHOUSE}"/libcuvs*.whl \
1929
"$(echo "${CUVS_WHEELHOUSE}"/cuvs*.whl)[test]"
2030

conda/recipes/libcuvs/recipe.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ outputs:
134134
- libcurand
135135
- libcusolver
136136
- libcusparse
137-
- if: cuda_major == "13"
138-
then:
139-
- libnvjitlink
140137
ignore_run_exports:
141138
by_name:
142139
- cuda-cudart
@@ -150,9 +147,6 @@ outputs:
150147
- librmm
151148
- mkl
152149
- nccl
153-
- if: cuda_major == "13"
154-
then:
155-
- libnvjitlink
156150
about:
157151
homepage: ${{ load_from_file("python/libcuvs/pyproject.toml").project.urls.Homepage }}
158152
license: ${{ load_from_file("python/libcuvs/pyproject.toml").project.license }}
@@ -203,9 +197,6 @@ outputs:
203197
- libcurand
204198
- libcusolver
205199
- libcusparse
206-
- if: cuda_major == "13"
207-
then:
208-
- libnvjitlink
209200
ignore_run_exports:
210201
by_name:
211202
- cuda-cudart
@@ -219,9 +210,6 @@ outputs:
219210
- librmm
220211
- mkl
221212
- nccl
222-
- if: cuda_major == "13"
223-
then:
224-
- libnvjitlink
225213
about:
226214
homepage: ${{ load_from_file("python/libcuvs/pyproject.toml").project.urls.Homepage }}
227215
license: ${{ load_from_file("python/libcuvs/pyproject.toml").project.license }}
@@ -270,9 +258,6 @@ outputs:
270258
- libcurand
271259
- libcusolver
272260
- libcusparse
273-
- if: cuda_major == "13"
274-
then:
275-
- libnvjitlink
276261
ignore_run_exports:
277262
by_name:
278263
- cuda-cudart
@@ -283,9 +268,6 @@ outputs:
283268
- libcurand
284269
- libcusolver
285270
- libcusparse
286-
- if: cuda_major == "13"
287-
then:
288-
- libnvjitlink
289271
- librmm
290272
- mkl
291273
- nccl
@@ -436,9 +418,6 @@ outputs:
436418
- libcurand
437419
- libcusolver
438420
- libcusparse
439-
- if: cuda_major == "13"
440-
then:
441-
- libnvjitlink
442421
ignore_run_exports:
443422
by_name:
444423
- cuda-cudart
@@ -449,9 +428,6 @@ outputs:
449428
- libcurand
450429
- libcusolver
451430
- libcusparse
452-
- if: cuda_major == "13"
453-
then:
454-
- libnvjitlink
455431
- librmm
456432
- mkl
457433
- nccl

dependencies.yaml

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ dependencies:
286286
- clang==20.1.4
287287
- clang-tools==20.1.4
288288
- libclang==20.1.4
289+
# 'cuda_version' intentionally does not contain fallback entries... we want
290+
# a loud error if an unsupported 'cuda' value is passed
289291
cuda_version:
290292
specific:
291293
- output_types: conda
@@ -314,6 +316,51 @@ dependencies:
314316
cuda: "13.1"
315317
packages:
316318
- cuda-version=13.1
319+
- output_types: requirements
320+
matrices:
321+
# if use_cuda_wheels=false is provided, do not add dependencies on any CUDA wheels
322+
# (e.g. for DLFW and pip devcontainers)
323+
- matrix:
324+
use_cuda_wheels: "false"
325+
packages:
326+
- matrix:
327+
arch: aarch64
328+
cuda: "12.2"
329+
use_cuda_wheels: "true"
330+
packages:
331+
# some components (like nvidia-cublas-cu12 and nvidia-cuda-nvcc-cu12) didn't have
332+
# aarch64 wheels until CTK 12.3, so allow a slightly looser bound here
333+
- cuda-toolkit>=12.2,<12.4
334+
- matrix:
335+
cuda: "12.2"
336+
use_cuda_wheels: "true"
337+
packages:
338+
- cuda-toolkit==12.2.*
339+
- matrix:
340+
cuda: "12.5"
341+
use_cuda_wheels: "true"
342+
packages:
343+
- cuda-toolkit==12.5.*
344+
- matrix:
345+
cuda: "12.8"
346+
use_cuda_wheels: "true"
347+
packages:
348+
- cuda-toolkit==12.8.*
349+
- matrix:
350+
cuda: "12.9"
351+
use_cuda_wheels: "true"
352+
packages:
353+
- cuda-toolkit==12.9.*
354+
- matrix:
355+
cuda: "13.0"
356+
use_cuda_wheels: "true"
357+
packages:
358+
- cuda-toolkit==13.0.*
359+
- matrix:
360+
cuda: "13.1"
361+
use_cuda_wheels: "true"
362+
packages:
363+
- cuda-toolkit==13.1.*
317364
cuda:
318365
common:
319366
- output_types: [conda]
@@ -337,26 +384,40 @@ dependencies:
337384
packages:
338385
cuda_wheels:
339386
specific:
387+
# cuVS needs 'nvJitLink>={whatever-cuvs-was-built-against}' at runtime, and mixing
388+
# old-CTK with new-nvJitLink is supported, so maintain 1 entry here per CUDA major.minor
389+
# cuVS is built against.
390+
#
391+
# nvJitLink has historically roughly followed the CTK's minor versioning scheme,
392+
# but check at https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
340393
- output_types: [requirements, pyproject]
341394
matrices:
395+
# skip this whole group if explicitly opting out of CUDA wheels
342396
- matrix:
343-
cuda: "12.*"
344-
use_cuda_wheels: "true"
397+
use_cuda_wheels: "false"
345398
packages:
346-
- cuda-toolkit[cublas,curand,cusolver,cusparse,nvjitlink]==12.*
399+
# We always want nvJitLink >= whatever minor version was available in the build environment
400+
# nvJitLink tends to follow the CTK's minor versions, but check at https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
401+
#
402+
# ref: https://github.com/rapidsai/cudf/pull/20873
347403
- matrix:
348-
cuda: "13.*"
404+
cuda: "12.9"
349405
use_cuda_wheels: "true"
350406
packages:
351-
- cuda-toolkit[cublas,curand,cusolver,cusparse,nvjitlink]==13.*
407+
- cuda-toolkit[cublas,curand,cusolver,cusparse]==12.*
408+
- nvidia-nvjitlink-cu12>=12.9,<13
352409
- matrix:
353-
use_cuda_wheels: "false"
410+
cuda: "13.*"
411+
use_cuda_wheels: "true"
354412
packages:
355-
# if no matching matrix selectors passed, list a range
413+
- &ctk_cu13 cuda-toolkit[cublas,curand,cusolver,cusparse]==13.*
414+
- &nvjitlink_cu13 nvidia-nvjitlink>=13.0,<14
415+
# if no matching matrix selectors passed, list the CUDA 13 requirement
356416
# (just as a source of documentation, as this populates pyproject.toml in source control)
357417
- matrix:
358418
packages:
359-
- cuda-toolkit[cublas,curand,cusolver,cusparse,nvjitlink]>=12,<14
419+
- *ctk_cu13
420+
- *nvjitlink_cu13
360421
depends_on_cupy:
361422
common:
362423
- output_types: conda

python/libcuvs/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ authors = [
1919
license = "Apache-2.0"
2020
requires-python = ">=3.11"
2121
dependencies = [
22-
"cuda-toolkit[cublas,curand,cusolver,cusparse,nvjitlink]>=12,<14",
22+
"cuda-toolkit[cublas,curand,cusolver,cusparse]==13.*",
2323
"libraft==26.4.*,>=0.0.0a0",
2424
"librmm==26.4.*,>=0.0.0a0",
25+
"nvidia-nvjitlink>=13.0,<14",
2526
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
2627
classifiers = [
2728
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)