Browse Source

Linux's ADL uses a busnumber in descending order for devices so enumerate them in the opposite order to windows.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
83a8367654
  1. 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++) { for (i = 0; i < devices; i++) {
int j, virtual_gpu = 0; int j, virtual_gpu = 0;
for (j = 0; j < devices; j++) { for (j = 0; j < devices; j++) {
if (i == j) if (i == j)
continue; continue;
#ifdef WIN32
if (adapters[j].iBusNumber < adapters[i].iBusNumber) if (adapters[j].iBusNumber < adapters[i].iBusNumber)
#else
if (adapters[j].iBusNumber > adapters[i].iBusNumber)
#endif
virtual_gpu++; virtual_gpu++;
} }
vadapters[virtual_gpu].virtual_gpu = i; vadapters[virtual_gpu].virtual_gpu = i;

Loading…
Cancel
Save