Use the CUDA driver for cuda.core device enumeration - #2674
Open
rwgk wants to merge 2 commits into
Open
Conversation
Update the newer foreign-context test to use the CUDA-visible device count and regenerate the Device stub after applying the original public PR NVIDIA#2533 change.
|
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 rather than the NVML system-device list.Device.get_all_devices()wherever examples or tests need CUDA-visible devices or a CUDA device count.cuda.core.system.Deviceonly when querying NVML-backed properties; tests of the raw system API continue to enumerate the complete NVML device list intentionally.Root cause
CUDA and NVML do not necessarily enumerate the same set of devices. On N1X, NVML reports both the RTX GPU and the NPU, while CUDA exposes only the RTX GPU. Using the NVML count for CUDA device construction therefore makes a system with one CUDA device appear to have two:
Device(1)then raisesValueError, and CUDA-oriented process queries against the NPU raiseNotSupportedError.cuda.core.Devicerepresents CUDA-visible compute devices, whereascuda.core.system.Devicerepresents devices exposed through NVML. This change keeps enumeration within the appropriate domain and uses the existing UUID-based conversion when a CUDA device needs an NVML-backed property.History
This is a current-main successor to #2533, which was closed after overlapping changes landed on the
13.4.xrelease line through #2437. The core implementation is therefore already present in13.4.xand in the ongoingmain-to-13.4.xintegration under #2641; this PR brings the complete, coherent change to current main.It preserves the original implementation and commit authorship, resolves the small overlaps with code added since #2533, updates one newer multi-GPU test to follow the same enumeration contract, and regenerates the
Devicestub.