gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 04:49:30 25 4
gpt4 key购买 nike

我正在使用 gpu,想获取 gpu 的序列号。在 NVIDIA 管理库中,有一个我可以使用的函数。函数原型(prototype)是。nvmlReturn_t nvmlDeviceGetSerial(nvmlDevice_t 设备,char* 序列号,无符号整数长度);第一个参数是“nvmlDevice_t device”。我搜索了很多但没有找到任何返回此类型的函数。那么我怎么才能得到这个呢?

最佳答案

引自documentation序言:

This chapter describes that queries that NVML can perform against each device. In each case the device is identified with an nvmlDevice_t handle. This handle is obtained by calling one of nvmlDeviceGetHandleByIndex(), nvmlDeviceGetHandleBySerial(), nvmlDeviceGetHandleByPciBusId(). or nvmlDeviceGetHandleByUUID().

有了它,获得所需句柄应该是不言自明的。

关于c++ - 哪个函数在 cuda/nvml 库中返回 "nvmlDevice_t"类型变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55377048/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com