Migrate pynvml to cuda.core.system#640
Conversation
|
/ok to test 3b9b740 |
|
/ok to test 408fe66 |
|
@mdboom there seems to be some style issues, could you try to automatically fix them with |
|
/ok to test 4e248fc |
1 similar comment
|
/ok to test 4e248fc |
|
Unfortunately you're not part of the |
|
/ok to test 9dfabb5 |
|
@mdboom there are errors occurring that I think are legit issues, see here for example: Are we supposed to bring NVML from conda to satisfy this? |
Interesting. NVML should be installed alongside the driver, so should basically "always" be there (as long as the system can do anything with the GPU). I thought the search here was equivalent to what pynvml was doing, but perhaps not. I'll poke around and see what I find. Created this bug to track the issue: NVIDIA/cuda-python#2189 |
|
Hi Mike, I think the failing CI case is a subtle difference in where the missing-NVML-library error is surfaced after the migration from In the old code, UCXX did: try:
pynvml.nvmlInit()
device_count = pynvml.nvmlDeviceGetCount()
...
except (
pynvml.NVMLError_LibraryNotFound,
pynvml.NVMLError_DriverNotLoaded,
pynvml.NVMLError_Unknown,
):
passFor CDLL("libnvidia-ml.so.1")If that With the current new code: try:
device_count = system.Device.get_device_count()
...
except (
system.NotFoundError,
system.DriverNotLoadedError,
system.UnknownError,
):
passthe missing-library error is currently escaping as: cuda.pathfinder.DynamicLibNotFoundErrorfrom My recommendation would be to add from cuda.pathfinder import DynamicLibNotFoundError
try:
device_count = system.Device.get_device_count()
...
except (
DynamicLibNotFoundError,
system.LibraryNotFoundError,
system.DriverNotLoadedError,
system.UnknownError,
):
passThe fact that |
|
Thanks for the analysis, @rwgk. We can discuss in NVIDIA/cuda-python#2189 whether |
This migrates from pynvml.py to the new Cython/cybind-based
cuda.core.system.I was unable to get my local development set up for testing this one, so it's untested.