gpuopenanalytics / pynvml

Provide Python access to the NVML library for GPU diagnostics
BSD 3-Clause "New" or "Revised" License
205 stars 31 forks source link

possibly integrating pynvx for Darwin as a substitute #29

Closed stas00 closed 3 years ago

stas00 commented 3 years ago

One of ipyexperiments users said pynvml didn't work on Darwin, but there is pynvx with the same API, so we made a transparent wrapper to make things work.

This is totally up to you, but I thought perhaps this can be integrated too: https://github.com/stas00/ipyexperiments/blob/a60a23141e2ecb11c0554f8be535fe6ccb831604/ipyexperiments/utils/pynvml_gate.py

I'd totally understand if you'd say that this is outside the scope of pynvml, in which case please feel free to close this issue as I have a workaround in place.

Moreover, I realize that if he said pynvml is not available then there is nothing really can be done inside pynvml, other than perhaps generating a dummy pynvml package on Darwin which declares pynvx as a dependency and loads it transparently as if it were pynvml.

What do you think?

I have no such need myself since I'm not on Darwin.

rjzamora commented 3 years ago

Thanks for the the suggestions, but I think you are right that this is probably outside the scope of pynvml. If I understand correctly, the suggestion is to support OS X by loading the pynvx.pynvml instead of this version of pynvml on Darwin systems? If so, I agree this should be handled elsewhere.

It may also be worth mentioning that pynvx seems to be wrapping nvidia-ml-py instead of this pynvml library. Note that we published this library in 2019 to help with RAPIDS developement, because the existing bindings were pretty stale at the time. Those older bindings may have improved since then :)

jakirkham commented 3 years ago

What GPU is being used? Macs typically don't ship with NVIDIA GPUs. So wouldn't expect this to work there. Is this using some sort of external GPU?

stas00 commented 3 years ago

It was a long time ago, originally discussed here https://github.com/fastai/fastai/issues/1657, but I don't see any details that answer your questions to the hardware specifics. Since at that time there was no active support for nvidia-ml-py all other libraries relying on some version of python nvml had to improvise.

And yes at that time we were using nvidia-ml-py, but since now there is support for pynvml I switched over to using it. Those old bindings are still old bindings, no changes to either library since 2-3 years ago.

Let's just close it for now. Thank you for the feedback.