Question

I am trying to execute some CUDA code which happens to have some NVML library functions like nvmlSystemGetDriverVersion. But, when I try to compile the code it says nvml.h not found. How should I install NVML on my system since nvml.h does not seem to be present on it?

Was it helpful?

Solution

A google search of "nvidia nvml" returns this as the first link. This page contains links for the API documentation.

On that page, if you click on the Tesla Deployment Kit link, you can then find the download links appropriate for your OS (windows or linux) and CUDA version (cuda 5.0 or cuda 4.2)

The Tesla Deployment kit contains the header file you mention (nvml.h) as well as some libraries you will probably need to link against, in order to use the NVML functions.

There are sample build projects including makefiles in the Tesla Deployment Kit which should answer any questions about how to compile and link using assets from the kit.

EDIT: there is an example project in .../tdk_3.xxxx/nvml/example There is a sample makefile in that example project directory. If you inspect that makefile, you'll see that to link in the nvml library your compile command will need to include something like:

-L/path/to/nvml/lib64/ -lnvidia-ml
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top