Skip to content

Commit

Permalink
Reinstate fix ADL gpu-map not working when there are more ADL devices…
Browse files Browse the repository at this point in the history
… than openCL patch by Nite69. Add virtual adl mapping for when none is specified on the command line to not crash without a map specified.
  • Loading branch information
ckolivas committed Aug 20, 2012
1 parent bb401c5 commit 933627e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions adl.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,10 @@ void init_adl(int nDevs)
if (gpus[i].mapped) {
vadapters[gpus[i].virtual_adl].virtual_gpu = i;
applog(LOG_INFO, "Mapping OpenCL device %d to ADL device %d", i, gpus[i].virtual_adl);
}
} else
gpus[i].virtual_adl = i;
}

if (!devs_match) {
applog(LOG_ERR, "WARNING: Number of OpenCL and ADL devices did not match!");
applog(LOG_ERR, "Hardware monitoring may NOT match up with devices!");
Expand Down Expand Up @@ -347,11 +348,12 @@ void init_adl(int nDevs)
int iAdapterIndex;
int lpAdapterID;
ADLODPerformanceLevels *lpOdPerformanceLevels;
int lev;
int lev, adlGpu;

i = vadapters[gpu].id;
adlGpu = gpus[gpu].virtual_adl;
i = vadapters[adlGpu].id;
iAdapterIndex = lpInfo[i].iAdapterIndex;
gpus[gpu].virtual_gpu = vadapters[gpu].virtual_gpu;
gpus[gpu].virtual_gpu = vadapters[adlGpu].virtual_gpu;

/* Get unique identifier of the adapter, 0 means not AMD */
result = ADL_Adapter_ID_Get(iAdapterIndex, &lpAdapterID);
Expand All @@ -361,11 +363,11 @@ void init_adl(int nDevs)
}

if (gpus[gpu].deven == DEV_DISABLED) {
gpus[i].gpu_engine =
gpus[i].gpu_memclock =
gpus[i].gpu_vddc =
gpus[i].gpu_fan =
gpus[i].gpu_powertune = 0;
gpus[gpu].gpu_engine =
gpus[gpu].gpu_memclock =
gpus[gpu].gpu_vddc =
gpus[gpu].gpu_fan =
gpus[gpu].gpu_powertune = 0;
continue;
}

Expand Down

0 comments on commit 933627e

Please sign in to comment.