You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix device attribute handling for older drivers (NVIDIA#1437)
* Fix device attribute handling for older drivers
Add explicit default value handling for device attributes that may not
be supported by older CUDA drivers. When cuDeviceGetAttribute returns
CUDA_ERROR_INVALID_VALUE, return a sensible default instead of raising
an error.
- Add default parameter to _get_attribute() and _get_cached_attribute()
- Use default=0 for boolean/enablement attributes (returns False)
- Use default=1 for mem_sync_domain_count (single domain is traditional behavior)
- Use default=-1 for host_numa_id (indicates NUMA not supported)
- Document that gpu_pci_device_id/gpu_pci_subsystem_id return 0 if unsupported
ClosesNVIDIA#1420
* Add exception specifiers and refine attribute defaults
- Add except? -2 to _get_attribute and _get_cached_attribute for proper
exception propagation (-2 never clashes with valid return values)
- Keep default parameter untyped to allow None, cast to int when used
- Simplify gpu_pci_device_id/gpu_pci_subsystem_id to return 0 when
unsupported (0 is never a valid PCI ID)
0 commit comments