• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

How can I read GPU sensors via C code?

Kazem Shekofteh

New Member
Joined
Jan 18, 2015
Messages
4 (0.00/day)
Please help me
I need to read some sensors of my GTX 760 GPU (such as GPU core clock, power, temperature, etc) and also similar sensors of my Intel HD 4600 embedded in my Intel Core i7.
I have tried NVAPI in cuda. It did not completely cover my needs. It does not fully support my GPU and only temperature sensor can be read there.
I need to write something like CPU-Z software. It is very critical to me.

Thanks
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
26,956 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
NVAPI does provide the sensor data you are looking for, but maybe the relevant headers are part of the NDA version of the SDK. Try contacting NVIDIA.

Another method you could use is to access the shared memory of GPU-Z, which provides the sensor readings, but requires GPU-Z running in the background.
 

Kazem Shekofteh

New Member
Joined
Jan 18, 2015
Messages
4 (0.00/day)
Thanks for your reply.
What do you mean by "NDA version of the SDK"?
How is it possible to access the shared memory of GPU-Z? Could please provide me a sample?

Do you know about nvml? I get error when calling some of its functions like nvmlDeviceGetClockInfo(...) while this function runs correctly on another Geforce model.
 
Last edited by a moderator:

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
26,956 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit

Kazem Shekofteh

New Member
Joined
Jan 18, 2015
Messages
4 (0.00/day)
Thank you
I start to read the instructions in the link.

It is stated in the NVML API reference manual that it is supported on Tesla, Quadro and GRID. But for some functions some other GPUs are supported. For example my GPU supports the function for reading temperature.
The most strange thing is that the function for reading clock frequency which is not supported on my laptop (Geforce 740M) is correctly executed on another laptop with a Geforce 760M GPU. Both of them are from Kepler family.
 
Top