Question

I am trying to get GPU temperature on mac's OSX platform programmatically

I tried to google for solutions but I can't find it , all I could find is CPU temperature and GPU usage in percentage.

Is there some API or library that allows to retrieve the sensors data ?

can someone please tell me where to start ? or maybe provide some example?

Was it helpful?

Solution

https://developer.nvidia.com/cuda-faq

Q: How can I get information on GPU temperature from my application? On Microsoft Windows platforms, NVIDIA's NVAPI gives access to GPU temperature and many other low-level GPU functions

Under Linux, the "nvidia-smi" utility, which is included with the standard driver install, also displays GPU temperature for all installed devices.

EDIT

While looking further about "nvidia-smi" utility which has been provided by linux based system, i found that they have provided C based API to fetch the GPU temperature.

https://developer.nvidia.com/nvidia-management-library-nvml https://developer.nvidia.com/nvidia-system-management-interface

https://developer.nvidia.com/sites/default/files/akamai/cuda/files/CUDADownloads/NVML_cuda5/nvml.4.304.55.pdf

From manual, I could see that below API can be used to find out which has been provided by "nvidia-smi":

7.9.2.8 nvmlReturn_t DECLDIR nvmlUnitGetTemperature (nvmlUnit_t unit, unsigned int type, unsigned
int  temp)
Retrieves the temperature readings for the unit, in degrees C.
For S-class products.
Depending on the product, readings may be available for intake (type=0), exhaust (type=1) and board (type=2).
Parameters:
unit The identifier of the target unit
type The type of reading to take
temp Reference in which to return the intake temperature
Returns:
• NVML_SUCCESS if temp has been populated
• NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
• NVML_ERROR_INVALID_ARGUMENT if unit or type is invalid or temp is NULL
• NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
• NVML_ERROR_UNKNOWN on any unexpected error

Hope this would be useful and this way you can achieve your requirement. "nvidia-smi" internally uses the above API to find out the temperature of GPU which which user get.This is command line utility provided by NVIDIA.

OTHER TIPS

try this one named "magican", it's icon is an elephant, cpu and gpu temperature can show in the status bar,when click,you can see the progresses you launched http://i.stack.imgur.com/ekeW2.png

download from http://www.magicansoft.com/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top