1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-15 00:59:59 +00:00

Reinstate fix ADL gpu-map not working when there are more ADL devices 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.

This commit is contained in:
Con Kolivas 2012-08-20 10:34:25 +10:00
parent bb401c5528
commit 933627e73b

20
adl.c
View File

@ -306,7 +306,8 @@ void init_adl(int nDevs)
if (gpus[i].mapped) { if (gpus[i].mapped) {
vadapters[gpus[i].virtual_adl].virtual_gpu = i; vadapters[gpus[i].virtual_adl].virtual_gpu = i;
applog(LOG_INFO, "Mapping OpenCL device %d to ADL device %d", i, gpus[i].virtual_adl); 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) { if (!devs_match) {
@ -347,11 +348,12 @@ void init_adl(int nDevs)
int iAdapterIndex; int iAdapterIndex;
int lpAdapterID; int lpAdapterID;
ADLODPerformanceLevels *lpOdPerformanceLevels; ADLODPerformanceLevels *lpOdPerformanceLevels;
int lev; int lev, adlGpu;
i = vadapters[gpu].id; adlGpu = gpus[gpu].virtual_adl;
i = vadapters[adlGpu].id;
iAdapterIndex = lpInfo[i].iAdapterIndex; 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 */ /* Get unique identifier of the adapter, 0 means not AMD */
result = ADL_Adapter_ID_Get(iAdapterIndex, &lpAdapterID); result = ADL_Adapter_ID_Get(iAdapterIndex, &lpAdapterID);
@ -361,11 +363,11 @@ void init_adl(int nDevs)
} }
if (gpus[gpu].deven == DEV_DISABLED) { if (gpus[gpu].deven == DEV_DISABLED) {
gpus[i].gpu_engine = gpus[gpu].gpu_engine =
gpus[i].gpu_memclock = gpus[gpu].gpu_memclock =
gpus[i].gpu_vddc = gpus[gpu].gpu_vddc =
gpus[i].gpu_fan = gpus[gpu].gpu_fan =
gpus[i].gpu_powertune = 0; gpus[gpu].gpu_powertune = 0;
continue; continue;
} }