NvPhysicalGpuHandle of CUDA device

Hi!

How can I get nvAPI NvPhysicalGpuHandle of some CUDA device under Windows?
For example I choose a device with cudaChooseDevice(X, …). How can I found out a current GPU temperature or BUS type (AGP/PCIe)?
I can’t find this information :wacko: , but it’s clear that nvcuda.dll uses nvapi.dll internally.

One more question: how can I get this info in linux?

Thanks!

CUDA and NVAPI are very different beasts, and as far as I know there’s no correlation between the two.

CUDA and NVAPI are very different beasts, and as far as I know there’s no correlation between the two.

Even if they are different I guess it’s possible to use them together.

Another thing is that they are already unofficially used together.

When I load my CUDA program I see nvapi.dll in address space of my program. This means that some part of CUDA runtime loads nvAPI.

Here is content of address space of template.exe from CUDA SDK 2.0.

[codebox]

|Name| |Base| |Size| |InMem| |MM||Build Time| |Version| |Description| |Company| |Full Path|

ADVAPI32.dll 77DA0000 696.320 81.920 2008-04-14 04:20:40 5.1.2600.5512 (xpsp.080413-2113) Erweitertes Windows 32 Base-API Microsoft Corporation C:\WINDOWS\system32\ADVAPI32.dll

comctl32.dll 773A0000 1.060.864 163.840 2008-04-14 04:20:10 6.0 (xpsp.080413-2105) User Experience Controls Library Microsoft Corporation C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll

comctl32.dll 5D450000 630.784 106.496 2008-04-14 04:20:57 5.82 (xpsp.080413-2105) Common Controls Library Microsoft Corporation C:\WINDOWS\system32\comctl32.dll

cudart.dll 10000000 192.512 151.552 2008-07-16 22:09:00 C:\CUDA\bin\cudart.dll

cutil32.dll 00340000 274.432 274.432 2008-08-11 12:28:08 C:\Programme\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\Release\cutil32.dll

DCIMAN32.dll 73B30000 24.576 20.480 2008-04-14 04:20:38 5.1.2600.5512 (xpsp.080413-2105) DCI Manager Microsoft Corporation C:\WINDOWS\system32\DCIMAN32.dll

DDRAW.dll 736D0000 307.200 36.864 2008-04-14 04:20:39 5.03.2600.5512 (xpsp.080413-0845) Microsoft DirectDraw Microsoft Corporation C:\WINDOWS\system32\DDRAW.dll

GDI32.dll 77EF0000 299.008 81.920 2008-10-23 14:36:55 5.1.2600.5698 (xpsp_sp3_gdr.081022-1932) GDI Client DLL Microsoft Corporation C:\WINDOWS\system32\GDI32.dll

GLU32.dll 68FC0000 131.072 24.576 2008-04-14 04:20:36 5.1.2600.5512 (xpsp.080413-0845) OpenGL Utility Library DLL Microsoft Corporation C:\WINDOWS\system32\GLU32.dll

IMM32.DLL 76330000 118.784 28.672 2008-04-14 04:21:16 5.1.2600.5512 (xpsp.080413-2105) Windows XP IMM32 API Client DLL Microsoft Corporation C:\WINDOWS\system32\IMM32.DLL

kernel32.dll 7C800000 1.081.344 204.800 2008-04-14 04:21:52 5.1.2600.5512 (xpsp.080413-2111) Client-DLL für Windows NT-Basis-API Microsoft Corporation C:\WINDOWS\system32\kernel32.dll

LPK.DLL 62E10000 36.864 28.672 2008-04-14 04:21:08 5.1.2600.5512 (xpsp.080413-2105) Language Pack Microsoft Corporation C:\WINDOWS\system32\LPK.DLL

msvcrt.dll 77BE0000 360.448 155.648 2008-04-14 04:23:48 7.0.2600.5512 (xpsp.080413-2111) Windows NT CRT DLL Microsoft Corporation C:\WINDOWS\system32\msvcrt.dll

ntdll.dll 7C910000 745.472 229.376 2008-04-14 04:21:51 5.1.2600.5512 (xpsp.080413-2111) DLL für NT-Layer Microsoft Corporation C:\WINDOWS\system32\ntdll.dll

nvapi.dll 00AB0000 483.328 438.272 2008-10-08 00:15:20 6.14.11.7824 NVIDIA NVAPI Library, Version 178.24 NVIDIA Corporation C:\WINDOWS\system32\nvapi.dll

nvcuda.dll 00420000 1.560.576 1.298.432 2008-10-08 00:17:41 6.14.11.7824 NVIDIA Compatible CUDA Driver, Version 178.24 NVIDIA Corporation C:\WINDOWS\system32\nvcuda.dll

ole32.dll 774B0000 1.298.432 61.440 2008-04-14 04:21:40 5.1.2600.5512 (xpsp.080413-2108) Microsoft OLE für Windows Microsoft Corporation C:\WINDOWS\system32\ole32.dll

OLEAUT32.dll 770F0000 569.344 40.960 2008-04-14 04:21:41 5.1.2600.5512 Microsoft Corporation C:\WINDOWS\system32\OLEAUT32.dll

OPENGL32.dll 5F0D0000 835.584 172.032 2008-04-14 04:21:49 5.1.2600.5512 (xpsp.080413-0845) OpenGL Client DLL Microsoft Corporation C:\WINDOWS\system32\OPENGL32.dll

RPCRT4.dll 77E50000 598.016 40.960 2008-04-14 04:21:26 5.1.2600.5512 (xpsp.080413-2108) Remote Procedure Call Runtime Microsoft Corporation C:\WINDOWS\system32\RPCRT4.dll

Secur32.dll 77FC0000 69.632 24.576 2008-04-14 04:21:45 5.1.2600.5512 (xpsp.080413-2113) Security Support Provider Interface Microsoft Corporation C:\WINDOWS\system32\Secur32.dll

SETUPAPI.dll 778F0000 999.424 77.824 2008-04-14 04:21:29 5.1.2600.5512 (xpsp.080413-2111) Windows Setup-API Microsoft Corporation C:\WINDOWS\system32\SETUPAPI.dll

SHELL32.dll 7E670000 8.523.776 122.880 2008-06-17 21:00:55 6.00.2900.5622 (xpsp_sp3_gdr.080617-1319) Allgemeine Windows-Shell-DLL Microsoft Corporation C:\WINDOWS\system32\SHELL32.dll

SHLWAPI.dll 77F40000 483.328 53.248 2008-04-14 04:21:40 6.00.2900.5512 (xpsp.080413-2105) Shell Light-weight Utility Library Microsoft Corporation C:\WINDOWS\system32\SHLWAPI.dll

template.exe 00400000 90.112 90.112 2008-08-11 12:30:44 C:\Programme\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\Release\template.exe

USER32.dll 7E360000 593.920 114.688 2008-04-14 04:21:43 5.1.2600.5512 (xpsp.080413-2105) Client-DLL für Windows XP USER-API Microsoft Corporation C:\WINDOWS\system32\USER32.dll

USP10.dll 75790000 438.272 45.056 2008-04-14 04:21:45 1.0420.2600.5512 (xpsp.080413-2105) Uniscribe Unicode script processor Microsoft Corporation C:\WINDOWS\system32\USP10.dll

[/codebox]

Library nvapi.dll is present as well as cudart.dll and nvcuda.dll!

What I can say for sure now after some investigation is: nvapi.dll calls functions NvAPI_GetAssociatedNvidiaDisplayHandle, NvAPI_GetLogicalGPUFromDisplay and NvAPI_GetLogicalGPUFromPhysicalGPU while executing D3D functions of CUDA subsystem…
One of this functions are using NvPhysicalGpuHandle as input. Can I get this NvPhysicalGpuHandle from library somehow?

PS: and does this combination of function calls means that I can only get NvPhysicalGpuHandle of GPU with attached screen?