通過nvapi可以獲得gpu的溫度和效能引數。主頁在這裡:
我的**基礎是來自網際網路,不過略加變化。首先是獲取物理gpu,然後是獲取溫度,最後是獲取gpu效能。另外,獲取gpu效能不需要自己通過offset從dll中匯出函式。
#include
"stdafx.h"
#include
"r313-developer/nvapi.h"
int _tmain(int argc, _tchar* ar**); ret = nvapi_initialize(); if (!ret == nvapi_ok) nvapi_shortstring ver; nvapi_getinte***ceversionstring(ver); printf("nvapi version: %s\n", ver); nvu32 cnt; nvphysicalgpuhandle phys; ret = nvapi_enumphysicalgpus(&phys, &cnt); if (!ret == nvapi_ok) nvapi_shortstring name; nv_gpu_thermal_settings thermal; ret = nvapi_gpu_getfullname(phys, name); if (!ret == nvapi_ok) printf("name: %s\n", name); thermal.version = nv_gpu_thermal_settings_ver; ret = nvapi_gpu_getthermalsettings(phys,0, &thermal); if (!ret == nvapi_ok) printf("temp: %u c\n", static_cast
(thermal.sensor[0].currenttemp)); nv_gpu_dynamic_pstates_info_ex infoex; infoex.version = nv_gpu_dynamic_pstates_info_ex_ver; ret = nvapi_gpu_getdynamicpstatesinfoex(phys, &infoex); if (!ret == nvapi_ok) //printf("physical gpu utilization%s", infoex.utilization[0].);
return
0;
再分享一下我老師大神的人工智慧教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智慧的隊伍中來!
通過nvapi可以獲得gpu的溫度和效能引數。主頁在這裡:
我的**基礎是來自網際網路,不過略加變化。首先是獲取物理gpu,然後是獲取溫度,最後是獲取gpu效能。另外,獲取gpu效能不需要自己通過offset從dll中匯出函式。
#include
"stdafx.h"
#include
"r313-developer/nvapi.h"
int _tmain(int argc, _tchar* ar**); ret = nvapi_initialize(); if (!ret == nvapi_ok) nvapi_shortstring ver; nvapi_getinte***ceversionstring(ver); printf("nvapi version: %s\n", ver); nvu32 cnt; nvphysicalgpuhandle phys; ret = nvapi_enumphysicalgpus(&phys, &cnt); if (!ret == nvapi_ok) nvapi_shortstring name; nv_gpu_thermal_settings thermal; ret = nvapi_gpu_getfullname(phys, name); if (!ret == nvapi_ok) printf("name: %s\n", name); thermal.version = nv_gpu_thermal_settings_ver; ret = nvapi_gpu_getthermalsettings(phys,0, &thermal); if (!ret == nvapi_ok) printf("temp: %u c\n", static_cast
(thermal.sensor[0].currenttemp)); nv_gpu_dynamic_pstates_info_ex infoex; infoex.version = nv_gpu_dynamic_pstates_info_ex_ver; ret = nvapi_gpu_getdynamicpstatesinfoex(phys, &infoex); if (!ret == nvapi_ok) //printf("physical gpu utilization%s", infoex.utilization[0].);
return
0;
用NVAPI獲取GPU資訊
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!通過nvapi可以獲得gpu的溫度和效能引數。主頁在這裡 我的 基礎是來自網際網路,不過略加變化。首先是獲取物理gpu,然後是獲取溫度,最後是獲取gpu效能。另外,獲取gpu效能不需要自己通過offset從dll中匯出函式。include stda...
Linux Windows檢視GPU資訊
nvidia smiwindows系統下 需要進入到 c program files nvidia corporation nvsmi 此路徑下,再輸入上述命令,即 cd c program files nvidia corporation nvsmi nvidia smi 或者是把上述路徑新增到環...
python檢視顯示卡gpu資訊
需要使用pynvml庫 官網 現階段pip安裝的命令為 sudo pip install nvidia ml pyimport pynvml pynvml.nvmlinit 這裡的1是gpu id handle pynvml.nvmldevicegethandlebyindex 1 meminfo ...