cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

forestmurder
Journeyman III

How do get the physical flag for a cl_device_id.

      I have multiple GPUs, and they have the same name, such as "HD 7970". My program has multiple tasks, each task relate to a cl_device_id(for example, 3 GPUs and 6 tasks), at this time, the 6 cl_device_id are different pointer but they may be on the same physical GPU, however, I want to know for a certern task, which GPU I'm using now, Is there any way?

     I thought that I could call clGetDeviceInfo to get the physical id for the gpu, or which pcie slot the gpu plugged in, but I didn't found these properties.

0 Likes
5 Replies
nou
Exemplar

Re: How do get the physical flag for a cl_device_id.

clGetDeviceIDs() always return cl_device_id for different GPU so you can index to them from 0 to N. on Linux you can use device topology extension for AMD which return PCI ids. you pass CL_DEVICE_TOPOLOGY_AMD to clGetDeviceInfo() and you get array of three in. but it work only on Linux.

himanshu_gautam
Grandmaster

Re: How do get the physical flag for a cl_device_id.

Are you working on Windows or Linux? Linux support is already there, and Windows support can be prioritized in case many users need the feature.

0 Likes
forestmurder
Journeyman III

Re: How do get the physical flag for a cl_device_id.

thanks very much, I'm working on Windows, and the cl_device_id is pass from a share library, so I can't index them.

0 Likes
forestmurder
Journeyman III

Re: How do get the physical flag for a cl_device_id.

Does the cl_device_id return from clGetDeviceIDs() is always the same? I mean that if I have 3 GPUs, the first time I call clGetDeviceIDs, then I index the 3 cl_device_ids, however, then I call the clGetDeviceIDs again, the 3 cl_device_ids are the same order with last time?

0 Likes
himanshu_gautam
Grandmaster

Re: How do get the physical flag for a cl_device_id.

i have added your reference in the request for developing this feature. So far 3 different people have asked for it on forums

0 Likes