Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Users mailing list

Subject: Re: [hwloc-users] OpenGL GPU detection code
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2013-01-30 02:05:40

Le 29/01/2013 17:15, Stefan Eilemann a écrit :
> On 29. Jan 2013, at 17:07, Brice Goglin <Brice.Goglin_at_[hidden]> wrote:
>> The current plan is to have some OpenCL device info and some OpenGL
>> device info appear inside GPU PCI devices. That said, I am still not
>> confident about the current OpenGL thing. The current branch manipulates
>> what I usually call a display (":0.0") which seem rather X than OpenGL
>> related, but I am not familiar with all this at all anyway.
> For OpenGL applications on Linux this is the only way how they can identify a single GPU device. Typically the X server is set up such that a screen maps to a device, and the NVCTRL extension provides us with the mapping from X screen to PCI id -- and glX is the GL / X11 glue.
> One can access multiple GPU devices through a single X Display* connection (":0") by selecting different screens (with "1" being the DefaultScreen( display ) for ":0.1").
> One might also configure a separate X server for each device with a single screen, or any combination of server (port) / device (screen) mapping.
> On Windows it's even more complicated, see

If there's nothing like :0.0 on windows, is there something equivalent
to a screen/device couple (0/0 in :0.0)?

We've been carrying this "gl" name since the beginning of this code, but
I still feel like all functions in hwloc/gl.h should rather be in
hwloc/X.h or X11.h or display.h or Xdisplay.h (and functions renamed

I am in the process of cleaning the branch code. One thing that will
change is that instead of having a new software object of type
"display", I will just reuse the existing GPU type. Inside a single GPU
PCI device, we may have a "cuda2" software object, a "nvml1" one, and a
new one called ":0.3".

I am also reducing the number of functions in hwloc/gl.h. We can't call
internal GL functions from there, because the GL code may be built as a
plugin. So we'll only have some inlines that basically traverse the list
of software devices, find the one corresponding to :0.3 and return it.
Once you have this, implementing the other functions is easy.