cuda.core: consolidate driver version query functions#2040
cuda.core: consolidate driver version query functions#2040leofang wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
Merge the two separate driver version query functions into a single get_driver_version() that returns (umd_version, kmd_version) — a pair of version tuples. UMD is a 2-tuple (major, minor) and KMD is a 3-tuple (major, minor, patch). The function now requires NVML. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ok to test bfd9ab9 |
|
Windows driver version strings only have two components, so nvmlSystemGetDriverVersion returns X.Y on WSL instead of X.Y.Z. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ok to test d2d387e |
| from .conftest import skip_if_nvml_unsupported | ||
|
|
||
|
|
||
| @skip_if_nvml_unsupported |
There was a problem hiding this comment.
Why does nvml have to be supported to check the driver version?
There was a problem hiding this comment.
Because this PR now uses NVML API calls exclusively.
There was a problem hiding this comment.
Yeah, I'd argue there should be more traces to the reader to make that obvious. That coupled with the incorrect header at the top of the file make it difficult to parse.
| assert 0 <= ver_patch[0] <= 99 | ||
| def test_driver_version_requires_nvml(): | ||
| if system.CUDA_BINDINGS_NVML_IS_COMPATIBLE: | ||
| pytest.skip("NVML is available, cannot test the error path") |
There was a problem hiding this comment.
More comments explaining why NVML being available prevents testing would be a good trace for the reader.
There was a problem hiding this comment.
Because this test needs a negation for @skip_if_nvml_unsupported.
|
Nit: the file-level comment at |
rparolin
left a comment
There was a problem hiding this comment.
The changes are correct but some added context would make it obvious to reader why its correct. I've labeled them as nit to not block this PR.
|
Let me wait for @mdboom blessing before merging |
Summary
Consolidate
get_driver_version()andget_driver_version_full()into a singleget_driver_version()that returns(umd_version, kmd_version)— a pair of version tuples (UMD is a 2-tuple(MAJOR, MINOR), KMD is a 3-tuple(MAJOR, MINOR, PATCH)).The function now requires NVML and raises
RuntimeErrorif it is not available.kernel_modeparameter and the separateget_driver_version_fullfunction