|
|
@ -21,6 +21,7 @@ |
|
|
|
#include "adl_functions.h" |
|
|
|
#include "adl_functions.h" |
|
|
|
|
|
|
|
|
|
|
|
bool adl_active; |
|
|
|
bool adl_active; |
|
|
|
|
|
|
|
bool opt_reorder = false; |
|
|
|
|
|
|
|
|
|
|
|
int opt_hysteresis = 3; |
|
|
|
int opt_hysteresis = 3; |
|
|
|
const int opt_targettemp = 75; |
|
|
|
const int opt_targettemp = 75; |
|
|
@ -268,21 +269,25 @@ void init_adl(int nDevs) |
|
|
|
* ordering the GPUs according to ascending order fixes it. Linux |
|
|
|
* ordering the GPUs according to ascending order fixes it. Linux |
|
|
|
* has usually sequential but decreasing order instead! */ |
|
|
|
* has usually sequential but decreasing order instead! */ |
|
|
|
for (i = 0; i < devices; i++) { |
|
|
|
for (i = 0; i < devices; i++) { |
|
|
|
int j, virtual_gpu = 0; |
|
|
|
int j, virtual_gpu; |
|
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < devices; j++) { |
|
|
|
if (opt_reorder) { |
|
|
|
if (i == j) |
|
|
|
virtual_gpu = 0; |
|
|
|
continue; |
|
|
|
for (j = 0; j < devices; j++) { |
|
|
|
|
|
|
|
if (i == j) |
|
|
|
|
|
|
|
continue; |
|
|
|
#ifdef WIN32 |
|
|
|
#ifdef WIN32 |
|
|
|
if (adapters[j].iBusNumber < adapters[i].iBusNumber) |
|
|
|
if (adapters[j].iBusNumber < adapters[i].iBusNumber) |
|
|
|
#else |
|
|
|
#else |
|
|
|
if (adapters[j].iBusNumber > adapters[i].iBusNumber) |
|
|
|
if (adapters[j].iBusNumber > adapters[i].iBusNumber) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
virtual_gpu++; |
|
|
|
virtual_gpu++; |
|
|
|
} |
|
|
|
} |
|
|
|
if (virtual_gpu != i) |
|
|
|
if (virtual_gpu != i) |
|
|
|
applog(LOG_INFO, "Mapping device %d to GPU %d according to Bus Number order", |
|
|
|
applog(LOG_INFO, "Mapping device %d to GPU %d according to Bus Number order", |
|
|
|
i, virtual_gpu); |
|
|
|
i, virtual_gpu); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
virtual_gpu = i; |
|
|
|
vadapters[virtual_gpu].virtual_gpu = i; |
|
|
|
vadapters[virtual_gpu].virtual_gpu = i; |
|
|
|
vadapters[virtual_gpu].id = adapters[i].id; |
|
|
|
vadapters[virtual_gpu].id = adapters[i].id; |
|
|
|
} |
|
|
|
} |
|
|
@ -293,6 +298,10 @@ void init_adl(int nDevs) |
|
|
|
} |
|
|
|
} |
|
|
|
applog(LOG_ERR, "WARNING: Number of OpenCL and ADL devices does not match!"); |
|
|
|
applog(LOG_ERR, "WARNING: Number of OpenCL and ADL devices does not match!"); |
|
|
|
applog(LOG_ERR, "Hardware monitoring may NOT match up with devices!"); |
|
|
|
applog(LOG_ERR, "Hardware monitoring may NOT match up with devices!"); |
|
|
|
|
|
|
|
for (i = 0; i < devices; i++) { |
|
|
|
|
|
|
|
vadapters[i].virtual_gpu = i; |
|
|
|
|
|
|
|
vadapters[i].id = adapters[i].id; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (gpu = 0; gpu < devices; gpu++) { |
|
|
|
for (gpu = 0; gpu < devices; gpu++) { |
|
|
|