-
Notifications
You must be signed in to change notification settings - Fork 237
cuda.core.system: Add device attributes, and other simple device-related APIs #1447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
19db128
826551f
ab57bc5
6855715
512dbb1
522d10c
e9beaf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,7 @@ from ._nvml_context cimport initialize | |||||
| include "_device_utils.pxi" | ||||||
|
|
||||||
|
|
||||||
| BrandType = nvml.BrandType | ||||||
| FieldId = nvml.FieldId | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -174,6 +175,77 @@ cdef class PciInfo: | |||||
| return self._pci_info.pci_device_id >> 16 | ||||||
|
|
||||||
|
|
||||||
| cdef class DeviceAttributes: | ||||||
| """ | ||||||
| Various device attributes. | ||||||
| """ | ||||||
| def __init__(self, attributes: nvml.DeviceAttributes): | ||||||
| self._attributes = attributes | ||||||
|
|
||||||
| @property | ||||||
| def multiprocessor_count(self) -> int: | ||||||
| """ | ||||||
| The streaming multiprocessor count | ||||||
| """ | ||||||
| return self._attributes.multiprocessor_count | ||||||
|
|
||||||
| @property | ||||||
| def shared_copy_engine_count(self) -> int: | ||||||
| """ | ||||||
| The shared copy engine count | ||||||
| """ | ||||||
| return self._attributes.shared_copy_engine_count | ||||||
|
|
||||||
| @property | ||||||
| def shared_decoder_count(self) -> int: | ||||||
| """ | ||||||
| The shared decoder engine count | ||||||
| """ | ||||||
| return self._attributes.shared_decoder_count | ||||||
|
|
||||||
| @property | ||||||
| def shared_encoder_count(self) -> int: | ||||||
| """ | ||||||
| The shared encoder engine count | ||||||
| """ | ||||||
| return self._attributes.shared_encoder_count | ||||||
|
|
||||||
| @property | ||||||
| def shared_jpeg_count(self) -> int: | ||||||
| """ | ||||||
| The shared JPEG engine count | ||||||
| """ | ||||||
| return self._attributes.shared_jpeg_count | ||||||
|
|
||||||
| @property | ||||||
| def shared_ofa_count(self) -> int: | ||||||
| """ | ||||||
| The shared optical flow accelerator (OFA) engine count | ||||||
| """ | ||||||
| return self._attributes.shared_ofa_count | ||||||
|
|
||||||
| @property | ||||||
| def gpu_instance_slice_count(self) -> int: | ||||||
| """ | ||||||
| The GPU instance slice count | ||||||
| """ | ||||||
| return self._attributes.gpu_instance_slice_count | ||||||
|
|
||||||
| @property | ||||||
| def compute_instance_slice_count(self) -> int: | ||||||
| """ | ||||||
| The compute instance slice count | ||||||
| """ | ||||||
| return self._attributes.compute_instance_slice_count | ||||||
|
|
||||||
| @property | ||||||
| def memory_size_mb(self) -> int: | ||||||
| """ | ||||||
| Device memory size in MiB | ||||||
|
||||||
| Device memory size in MiB | |
| Device memory size in MB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a deviation from the naming in NVML itself. What do you think, @leofang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it difficult to push a change to NVML? To correct the function so we can be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a breaking API change to NVML. We could ask them to add a second API and deprecate the old one, I suppose. But I suspect this is a pretty common inconsistency across CUDA APIs (MB vs. MiB) and unlikely to be worth the effort. (But I'm assuming lots there).
Uh oh!
There was an error while loading. Please reload this page.