-
Notifications
You must be signed in to change notification settings - Fork 235
Handle unsupported device attributes gracefully #1409
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
Conversation
…ries against older drivers.
|
/ok to test def7312 |
This comment has been minimized.
This comment has been minimized.
|
/ok to test 7e05f5a |
|
/ok to test 3f12cdb |
|
|
I think this was an oversight when the new attributes were added. We should not always return 0 because it'd shadow the actual issue (driver version insufficient) and our standard treatment is to add version checks in both the codebase and the corresponding test suite to ensure cuda-core runs with any CUDA driver 12.x and 13.x. This needs to be revisited before the next release is out. |
Summary
Adds defensive error handling in
DeviceProperties._get_attribute()to gracefully handle cases wherecuDeviceGetAttributereturnsCUDA_ERROR_INVALID_VALUEfor unsupported attributes.Changes
_get_attributein_device.pyxto check forCUDA_ERROR_INVALID_VALUEbefore raising an exception0as a conservative defaultvulkan_cig_supported),0meansFalse0indicates "not supported" or "disabled"Rationale
This addresses two scenarios:
CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED) withCUDA_ERROR_INVALID_VALUEPreviously, these scenarios would cause
DevicePropertiesproperties to raiseCUDAErrorexceptions, breaking tests and user code. With this change, unsupported attributes return sensible defaults (0/False) instead of raising exceptions.Test Coverage
CUDA_ERROR_INVALID_VALUE(e.g.,test_device.py) will now pass by returning0Related Work
cuda-corebuilt against CUDA 12.9