7 Replies Latest reply on Jul 3, 2012 4:13 PM by kcarney

    ADL_Overdrive5_Temperature_Get giving incorrect temperature value

    l.carroll

      Hi,

       

      I'm attempting to use ADL_Overdrive5_Temperature_Get to read the GPU temperature but it gives me incorrect temperature values, eg 180308.737 degrees! I appreciate any help you could offer.

       

      Is this card/environment supported for this API?

       

      AMD Radeon HD 6700M Series

      Windows 7 64 bit (running under Boot Camp on Apple iMac)

       

      My code:

       

      void tryAti() {

        int count = 0;

        LPAdapterInfo lpAdapterInfo = NULL;

        ADL_MAIN_CONTROL_CREATE          ADL_Main_Control_Create = NULL;

        ADL_MAIN_CONTROL_DESTROY         ADL_Main_Control_Destroy = NULL;

        ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get = NULL;

        ADL_ADAPTER_ADAPTERINFO_GET      ADL_Adapter_AdapterInfo_Get = NULL;

        ADL_OVERDRIVE5_TEMPERATURE_GET   ADL_Overdrive5_Temperature_Get = NULL;

        HMODULE hLib = LoadLibrary(L"atiadlxx.dll");

        if (!hLib) {

          hLib = LoadLibrary(L"atiadlxy.dll");

        }

        if (hLib) {

          ADL_Main_Control_Create = (ADL_MAIN_CONTROL_CREATE) GetProcAddress(hLib,"ADL_Main_Control_Create");

          ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY) GetProcAddress(hLib,"ADL_Main_Control_Destroy");

          ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET) GetProcAddress(hLib,"ADL_Adapter_NumberOfAdapters_Get");

          ADL_Adapter_AdapterInfo_Get = (ADL_ADAPTER_ADAPTERINFO_GET) GetProcAddress(hLib,"ADL_Adapter_AdapterInfo_Get");

          ADL_Overdrive5_Temperature_Get = (ADL_OVERDRIVE5_TEMPERATURE_GET) GetProcAddress(hLib, "ADL_Overdrive5_Temperature_Get");

          if (!(ADL_Main_Control_Create && ADL_Main_Control_Destroy && ADL_Adapter_NumberOfAdapters_Get &&

            ADL_Adapter_AdapterInfo_Get && ADL_Overdrive5_Temperature_Get)) {

              goto cleanup;

          }

          if (ADL_OK != ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1)) goto cleanup;

          if (ADL_OK != ADL_Adapter_NumberOfAdapters_Get(&count) && count > 0) goto cleanup;

          lpAdapterInfo = (LPAdapterInfo) malloc(sizeof (AdapterInfo) * count);

          if (!lpAdapterInfo) goto cleanup;

          if (ADL_OK != ADL_Adapter_AdapterInfo_Get (lpAdapterInfo, sizeof (AdapterInfo) * count)) goto cleanup;

          for (int i = 0; i < count; i++) {

            AdapterInfo info = lpAdapterInfo[i];

            debug(LOG_LEVEL_EXTREME, TEXT("tryAti() found adapter, index = %i, %S, %S, %S"),

            info.iAdapterIndex, info.strAdapterName, info.strDisplayName, info.strUDID);

            int iAdapterIndex = info.iAdapterIndex;

            ADLTemperature temp = {0};

            temp.iSize = sizeof(ADLTemperature);

            temp.iTemperature = -273;

            if (ADL_OK == ADL_Overdrive5_Temperature_Get(iAdapterIndex, 0, &temp)) {

              debug(LOG_LEVEL_EXTREME, TEXT("tryAti() temp = %f"), temp.iTemperature / 1000.0);

            }

          }

        }

      cleanup:

        if (lpAdapterInfo) free(lpAdapterInfo);

        if (ADL_Main_Control_Destroy) ADL_Main_Control_Destroy();

        if (hLib) FreeLibrary(hLib);

      }

       

      The debug method simply writes a formatted string to log file, results in:

      tryAti() found adapter, index = 0, AMD Radeon HD 6700M Series, \\.\DISPLAY1, PCI_VEN_1002&DEV_6740&SUBSYS_6740106B&REV_00_4&4DCA75F&0&0008A

      tryAti() temp = 184647.937000

      tryAti() found adapter, index = 1, AMD Radeon HD 6700M Series, \\.\DISPLAY2, PCI_VEN_1002&DEV_6740&SUBSYS_6740106B&REV_00_4&4DCA75F&0&0008&02A

      tryAti() temp = 180308.737000

      tryAti() found adapter, index = 2, AMD Radeon HD 6700M Series, \\.\DISPLAY3, PCI_VEN_1002&DEV_6740&SUBSYS_6740106B&REV_00_4&4DCA75F&0&0008&03A

      tryAti() temp = 180308.737000

      tryAti() found adapter, index = 3, AMD Radeon HD 6700M Series, \\.\DISPLAY4, PCI_VEN_1002&DEV_6740&SUBSYS_6740106B&REV_00_4&4DCA75F&0&0008&04A

      tryAti() temp = 180308.737000

      tryAti() found adapter, index = 4, AMD Radeon HD 6700M Series, \\.\DISPLAY5, PCI_VEN_1002&DEV_6740&SUBSYS_6740106B&REV_00_4&4DCA75F&0&0008&05A

      tryAti() temp = 180308.737000

       

      Open Hardware Monitor (http://openhardwaremonitor.org/) shows the same results for GPU temperature.

       

      GPU-Z (http://www.techpowerup.com/gpuz/) however seems to work, it shows 60 degrees C.

       

      What's GPU-Z accessing to get the correct value?