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
{{ message }}
Repository navigation
Commit e0d17f6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cuda): report missing driver library as an error (#10873)
## Summary
Makes missing CUDA driver support a normal initialization error instead
of a panic.
Previously, CudaContext::new and device_count called raw driver
functions that panic when the CUDA library cannot be loaded. Callers
had to probe for the library first or catch the panic, despite these APIs
returning Result.
Check driver availability in result::init and return CUDA_ERROR_NOT_INITIALIZED
when loading fails. Guard error-name and description lookup too, so formatting
that error does not try to call the unavailable driver.
With this handled in the driver wrapper, cuda_available no longer needs
its own probe, and CudaSession::try_default no longer needs catch_unwind.
The raw sys APIs retain their documented panic behavior.
Driver tests also stop silently passing on arbitrary context or stream
creation failures. They skip on NOT_INITIALIZED or NO_DEVICE and fail
on other setup errors.
## Changes
- fix(cuda): report a missing driver library as an error
- refactor(cuda): share the driver error description lookup
- test(cuda): fail driver tests whose CUDA setup fails
- Name the shared availability helper is_cuda_driver_present
---------
Signed-off-by: Alexander Droste <[email protected]>
0 commit comments