mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Linux's ADL uses a busnumber in descending order for devices so enumerate them in the opposite order to windows.
This commit is contained in:
parent
09ea6bd21a
commit
83a8367654
7
adl.c
7
adl.c
@ -238,13 +238,20 @@ void init_adl(int nDevs)
|
||||
}
|
||||
}
|
||||
|
||||
/* Windows has some kind of random ordering for bus number IDs and
|
||||
* ordering the GPUs according to ascending order fixes it. Linux
|
||||
* has usually sequential but decreasing order instead! */
|
||||
for (i = 0; i < devices; i++) {
|
||||
int j, virtual_gpu = 0;
|
||||
|
||||
for (j = 0; j < devices; j++) {
|
||||
if (i == j)
|
||||
continue;
|
||||
#ifdef WIN32
|
||||
if (adapters[j].iBusNumber < adapters[i].iBusNumber)
|
||||
#else
|
||||
if (adapters[j].iBusNumber > adapters[i].iBusNumber)
|
||||
#endif
|
||||
virtual_gpu++;
|
||||
}
|
||||
vadapters[virtual_gpu].virtual_gpu = i;
|
||||
|
Loading…
Reference in New Issue
Block a user