本文介绍了NVML头文件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行一些CUDA代码,恰好有一些
NVML库函数,如nvmlSystemGetDriverVersion。
但是,当我尝试编译代码,它说nvml.h没有找到。
我应该如何在我的系统上安装NVML,因为nvml.h似乎不存在

I am trying to execute some CUDA code which happens to have someNVML 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 seemto be present on it?

推荐答案

google搜索nvidia nvml会返回作为第一个链接。此页面包含API文档的链接。

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

在该页面上,如果您点击Tesla部署工具包,然后可以找到适合您的操作系统(windows或linux)和CUDA版本(cuda 5.0或cuda 4.2)的下载链接

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)

Tesla部署工具包包含您提及的头文件(nvml.h)以及您可能需要链接的一些库,以便使用NVML函数。

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.

有一些示例构建项目,包括Tesla部署工具包中的makefile,它们应该回答有关如何编译和使用工具包中的资源的任何问题。

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:在...中有一个示例项目/ tdk_3.xxxx / nvml / example
在示例项目目录中有一个示例makefile。
如果你检查makefile,你会看到链接在nvml库你的编译命令将需要包括类似:

there is an example project in .../tdk_3.xxxx/nvml/exampleThere 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

这篇关于NVML头文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 17:27