GPUOpen-LibrariesAndSDKs / display-library

AMD Display Library SDK
132 stars 46 forks source link

Radeon VII: temperature and fan state not supported #5

Open kinred opened 5 years ago

kinred commented 5 years ago

With a Radeon VII GPU both :

ADL2_OverdriveN_Temperature_Get(...)

and

ADL2_OverdriveN_FanControl_Get(...)

return errorcode -8

Tested with Windows Adrenalin driver version 19.2.2.

All other Vega and Polaris based GPUs work fine.

sergioberg commented 5 years ago

@kinred Did you find solution?

Grumpy-Dwarf commented 4 years ago

Any update or workaround for this? Does anyone know how to get temperature or a list of temperatures of Radeon VII programmatically?

sergioberg commented 4 years ago
    if (ADL_OK != ADL2_Main_Control_Create(ADL_Main_Memory_Alloc, 1, &context))
    {
        return -1002;
    }

    // Obtain the number of adapters for the system
    if (ADL_OK != ADL2_Adapter_NumberOfAdapters_Get(context, &iNumberAdapters))
    {
        return -1003;
    }

    if (0 < iNumberAdapters)
    {
        lpAdapterInfo = (LPAdapterInfo)malloc(sizeof(AdapterInfo) * iNumberAdapters);
        memset(lpAdapterInfo, '\0', sizeof(AdapterInfo) * iNumberAdapters);

        // Get the AdapterInfo structure for all adapters in the system
        ADL2_Adapter_AdapterInfo_Get(context, lpAdapterInfo, sizeof(AdapterInfo) * iNumberAdapters);
    }

    for (int i = 0; i < iNumberAdapters; i++)
    {
        int adapterActive = 0;
        AdapterInfo adapterInfo = lpAdapterInfo[i];
        ADL2_Adapter_Active_Get(context, adapterInfo.iAdapterIndex, &adapterActive);
        if (adapterActive && adapterInfo.iVendorID == AMDVENDORID)
        {
            adapterId = adapterInfo.iAdapterIndex;
            break;
        }
    }

    if (-1 == adapterId)
    {
        return -1004; //Cannot find active AMD adapter
    }

.......

    if (ADL_OK != ADL2_Overdrive_Caps(context, adapterId, &iOverdriveSupported, &iOverdriveEnabled, &iOverdriveVersion))
    {
        return -1005; //Can’t get Overdrive capabilities
    }

....... if (iOverdriveVersion == 8) { ADLPMLogDataOutput odlpDataOutput; memset(&odlpDataOutput, 0, sizeof(ADLPMLogDataOutput)); int error3 = ADL2_New_QueryPMLogData_Get(context, adapterId, &odlpDataOutput); if (ADL_OK != error3) { return error3; } if (odlpDataOutput.sensors[PMLOG_TEMPERATURE_EDGE].supported == 1) { return odlpDataOutput.sensors[PMLOG_TEMPERATURE_EDGE].value; } else { return -800; } } .........