Skip to content

Fix cuda_toolkit_check driver version and add cuda-bindings dep#148

Open
jayavenkatesh19 wants to merge 4 commits intorapidsai:mainfrom
jayavenkatesh19:fix-driver-major-and-cuda-bindings
Open

Fix cuda_toolkit_check driver version and add cuda-bindings dep#148
jayavenkatesh19 wants to merge 4 commits intorapidsai:mainfrom
jayavenkatesh19:fix-driver-major-and-cuda-bindings

Conversation

@jayavenkatesh19
Copy link
Copy Markdown
Contributor

@jayavenkatesh19 jayavenkatesh19 commented Apr 29, 2026

Summary

Two related fixes surfaced while smoke-testing #137 on a fresh Brev box:

  • cuda_toolkit_check was reading the kernel driver, not the CUDA driver. get_driver_version(kernel_mode=True) returns the NVIDIA kernel module version (e.g. 580 from 580.126.09), not the CUDA Driver API version (e.g. 13 from CUDA 13.0). The verbose message also printed Driver supports CUDA 580, which is what tipped this off. Dropping kernel_mode=True makes get_driver_version() default to the CUDA Driver API mode and the comparison logic actually fires.
  • cuda-bindings is now declared as a runtime dep, and the conda recipe gets the missing cuda-core it should have had since Add CUDA toolkit check to rapids doctor #141. cuda-core calls into cuda.bindings.driver via lazy import and without cuda-bindings installed, cuda_toolkit_check raises ImportError: cuda.bindings 12.x or 13.x must be installed on a fresh pip install rapids-cli. The pin >=12.9.6,!=13.0.*,!=13.1.* excludes the cuda-bindings 13.0/13.1 wheels and is compatible with both CUDA 12 and CUDA 13 driver hosts (verified with cuda-bindings 12.9.6 against a CUDA 13 environment and cuda-bindings 13.2 against a CUDA 12 environment).

A regression test (test_gather_toolkit_info_driver_major_is_cuda_major) exercises _gather_toolkit_info() end-to-end and asserts driver_major < 100 to ensure that we are getting the CUDA major version and not the driver version

Closes #145.

@jayavenkatesh19 jayavenkatesh19 requested review from a team as code owners April 29, 2026 15:30
@jayavenkatesh19 jayavenkatesh19 requested a review from bdice April 29, 2026 15:30
# Get driver version
try:
info.driver_major = get_driver_version(kernel_mode=True)[0]
info.driver_major = get_driver_version()[0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we purposely grabbing the user-mode driver version, e.g. 13.0.1. Instead of passing kernel_mode=True to grab kernel-mode driver version, e.g. 580.65.06.

Comment thread dependencies.yaml
- output_types: [conda, requirements, pyproject]
packages:
- cuda-core >=0.6.0
- cuda-bindings>=12.9.6,!=13.0.*,!=13.1.*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add a comment here and pyproject.toml with the reason behind this.

except Exception as e:
pytest.skip(f"_gather_toolkit_info unavailable on this platform: {e}")
if info.driver_major is not None:
assert info.driver_major < 100, (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to follow what are we testing here. Looks like we are testing that the major version of Are user-mode driver version, e.g. 13 in 13.0.1 is < 100 .

Don't we need to grab kernel-mode driver version, e.g. 580.65.06 like we we were doing? until now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cuda_toolkit_check fails on fresh install as cuda-bindings is not declared in dependencies

2 participants