Cldfire / nvml-wrapper

Safe Rust wrapper for the NVIDIA Management Library
Apache License 2.0
134 stars 32 forks source link

FailedToLoadSymbol("GetProcAddress failed") with Windows studio driver v536.99 #49

Closed joshhunt closed 1 year ago

joshhunt commented 1 year ago

I just upgraded nvidia windows drivers to "NVIDIA Studio Driver version 536.99" and I now get FailedToLoadSymbol("GetProcAddress failed") error when trying to initialize the library. I suspect this is due to the bindings being out of sync or something?

Is it possible to self re-generate/re-build the project to get compatibility with latest drivers? I've tried to find the source of nvml.h but haven't managed to track it down.

Cldfire commented 1 year ago

I've never tried this with the studio driver personally, so I'm not sure what would be going on there.

If you're hitting FailedToLoadSymbol("GetProcAddress failed") when trying to initialize, that's likely coming from our attempt to call nvmlInit_v2 in Nvml::init_internal:

https://github.com/Cldfire/nvml-wrapper/blob/1d71e81a23146759269b22e57c103f9f0b49d479/nvml-wrapper/src/lib.rs#L239

If you can confirm that's the source of the error, it's unlikely newer generated bindings will fix this (although you're welcome to try, I just committed #50 into main). nvmlInit_v2 has existed for years, here's a commit from 2020:

https://github.com/Cldfire/nvml-wrapper/blob/516c6da6c69b2ae060753b9240e22f030059c242/nvml-wrapper-sys/nvml.h#L100

Is it possible to self re-generate/re-build the project to get compatibility with latest drivers? I've tried to find the source of nvml.h but haven't managed to track it down.

Yes, you could try that as well. I get nvml.h from the CUDA toolkit download: https://developer.nvidia.com/cuda-downloads. After installation I copy C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include\nvml.h to nvml-wrapper-sys\nvml.h, and then you can run nvml-wrapper-sys\gen_bindings.sh to regenerate bindings (on Windows I run that script through WSL2).

Let me know if that gets you anywhere 😄.

joshhunt commented 1 year ago

Ahhh - it must have been the studio driver. Since updated/changed to the normal 'game ready' drivers and it's working all fine now. It didn't quite occur to me that could be the issue.

Reverting from the Studio drivers to the Game Ready drivers fixed the issue. Thanks!