I believe the device ID is an identifier unique only to the particular bus the device is attached to, rather than a globally unique ID for the entire system. Since PCI Express is a point-to-point "bus," I would not be surprised if all devices have ID 0.
I would use the device ID and bus ID as a tuple to uniquely identify devices. On Jan 13, 2014, at 12:28 PM, Peter Andrews <[email protected]> wrote: > I am new to PyCUDA. Since I work on a cluster and need to specify the gpu(s) > that I use I wrote the following pycuda_device.py: > > import pycuda.driver as drv > import pycuda > > print("PyCUDA version:", pycuda.VERSION_TEXT) > drv.init() > numGpus = drv.Device.count() > for gpuIndex in range(numGpus): > dev = drv.Device(gpuIndex) > print("Passed in gpu index:", gpuIndex, > "PCI_DEVICE_ID:", > dev.get_attribute(pycuda._driver.device_attribute.PCI_DEVICE_ID), > "PCI_BUS_ID:", > dev.get_attribute(pycuda._driver.device_attribute.PCI_BUS_ID)) > > > > > I get this result: > > python pycuda_device.py > ('PyCUDA version:', '2013.1.1') > ('Passed in gpu index:', 0, 'PCI_DEVICE_ID:', 0, 'PCI_BUS_ID:', 2) > ('Passed in gpu index:', 1, 'PCI_DEVICE_ID:', 0, 'PCI_BUS_ID:', 3) > > My question is: why is the PCI_DEVICE_ID 0 both times? > > Thanks, > > Peter Andrews > > _______________________________________________ > PyCUDA mailing list > [email protected] > http://lists.tiker.net/listinfo/pycuda _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
