can't find nvml dll in display drivers

Hello,
I am a developper on an application that uses cuda.
We would like to use nvml to do some verification.
I have linked with nvml.lib but the program can’t find the nvml.dll whatever version of the drivers I install ( currently 306.94 on Seven 64 bits).

I am using version 2.295.2 of nvml
Any advice?

Thanks

Hey Alpha666,

You may need to add nvml.dll to your path. During installation, the driver installer will not perform this step for you. nvml.dll is installed to you Program Files directory under “NVIDIA Corporation”\NVSMI. Only the 64 bit version of NVML is installed, so your application will need to be 64 bit as well, unless you are using COM.

Let me know if that solves your problem.

Thanks,
Robert Alexander

Thank you. It should really help ( our application is X64 only btw).

For those interested, a relatively clean way to do that is to do it with delay load libraries.
( VC++)

For that you need to add /delayload:nvml.dll to your command line and compile with structured exception (/EHa) ( look at code generation in c/c++ in your project options, it is necessary because the absence of the library ( no cuda installed on the computer ) will result in a C exception ).

then, the loading code is :

try
{
  #ifdef WIN32
  LoadLibraryEx("C:\Program Files\NVIDIA Corporation\NVSMI\nvml.dll",NULL,0);
  #endif
  WrapCall(nvmlInit());
}
catch(...)
{
  //nvml is disabled
}

Do not hesitate to contact me if you have questions on this topic.

Hi,
I’m beginner with cuda in windows, please tell me how and where i should use this code?
i’m using K40m and my OS is windows 10, i wanna measure power consumption of K40 and i did it before in linux, but in visual studio i get error of linker and i don’t know how to link nvml?