哪个函数返回 cuda/nvml 库中"nvmlDevice_t"类型变量?

Which function returns "nvmlDevice_t" type variable in cuda/nvml library?

本文关键字:nvmlDevice 类型变量 库中 nvml 函数 返回 cuda      更新时间:2023-10-16

我正在使用 gpu,想要获取 GPU 的序列号。在 NVIDIA 管理库中,我可以使用一个功能。函数原型是。 nvmlReturn_t nvmlDeviceGetSerial ( nvmlDevice_t device, char* serial, unsigned int length );第一个参数是"nvmlDevice_t设备"。我已经搜索了很多,但没有找到任何返回此类型的函数。那么我怎样才能得到这个呢?

引用

文档序言:

本章介绍 NVML 可以对每个 装置。在每种情况下,设备都用nvmlDevice_t 处理。此句柄是通过调用以下之一来获取的 nvmlDeviceGetHandleByIndex((, nvmlDeviceGetHandleBySerial((, nvmlDeviceGetHandleByPciBusId((.或 nvmlDeviceGetHandleByUUID((。

有了这个,获得您需要的手柄应该是相当不言自明的。