I’m trying to play arround with a sli setup and code to both devices. I was playing with getting it to set the fastest device and it have allways worked since my fastest device was device 0 anyway. but suddenly device 0 and 1 have changed in my system, without the cards beeing changed whic gave me some problems (I have a watercooled system so changing card isn’t something that you just do).
so my question is… isn’t device 0 and 1 numbered from their physical placement on the motherboard, or is it the driver that chooses?
The order that cards are enumerated in by the driver and the cuda libraries is undefined AFAIK. I seem to recall a time when it was even different between the order that nvidia-smi would show devices enumerated in and the order that the runtime API would return. I just went through an experience where I had a GT200 in PCI-e 1:0 and a Fermi in PCI-e 4:0, which used to be enumerated by CUDA as {4:0 = 0, 1:0 = 1}. I now have a Fermi in PCI-e 1:0 and a Fermi in PCI-e 4:0, and the CUDA enumeration is now {1:0 = 0, 4:0 = 1}…
Recent versions of the APIs expose the PCI express bus an device numbers. You could use those to “physically” ID the cards (presuming that the underlying operating system PCI-e enumerating stays constant). That is what I have started doing.