Use CUDA driver for CUDA device enumeration - #2533
Closed
isVoid wants to merge 1 commit into
Closed
Conversation
Contributor
isVoid
force-pushed
the
agent/use-cuda-device-enumeration
branch
from
August 7, 2026 20:55
d941211 to
882f9a9
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
cuda.core.Device.get_all_devices()enumerate devices through the CUDA driver instead of the NVML system-device listCudaDevice.get_all_devices()anywhere examples or tests require CUDA-compute devices or CUDA device countsRoot cause
On N1X, NVML enumerates both the RTX GPU and the NPU, while CUDA exposes only the RTX GPU. Using the NVML count for CUDA device construction makes a one-GPU system appear to have two CUDA devices:
Device(1)then fails, and NVML compute-process queries against the NPU returnNotSupported.Impact
CUDA device enumeration and multi-GPU test gates now reflect CUDA-visible compute devices. Non-CUDA NVML devices such as the N1X NPU no longer trigger false multi-GPU behavior or CUDA-only system queries.
Validation
Tested locally on Windows 11 ARM64 / N1X with CUDA 13.4 and native Python 3.13.15 ARM64 (
cp313-win_arm64):nvml_devices=2andcuda_devices=11 passed, 1 skipped;test_get_process_namepasses and the two-GPU green-context test skips correctly1196 passed, 89 skippedshow_device_properties.pyreports one GPU and exits successfully--no-pycodestyle) andgit diff --checkpass