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: Kenneth A. Lloyd (kenneth.lloyd_at_[hidden])
Date: 2013-02-01 10:09:22

Excellent! I think decoupling the device from the screen or display is
probably a good idea (even to my visualization domain work). When it comes
to looking up particular architectural features (say, the SM capability of
Tesla vs. Kepler), we can always fall back to a lookup table based upon

I'll try it out this weekend.

Ken Lloyd

-----Original Message-----
From: hwloc-users-bounces_at_[hidden]
[mailto:hwloc-users-bounces_at_[hidden]] On Behalf Of Brice Goglin
Sent: Friday, February 01, 2013 6:58 AM
To: Stefan Eilemann
Cc: Hardware locality user list
Subject: Re: [hwloc-users] OpenGL GPU detection code

I just committed big changes to the display branch (and I also merged latest
trunk changes).

lstopo will now report things like this:
        PCI 10de:06d1
          GPU L#0 ":0.0"
          GPU L#1 "cuda0"
          GPU L#2 "nvml0"

The changes include:

1) We don't have a "display" specific OS device anymore, it's just another
kind of GPU among cuda, opencl and nvml. The name is the X server display
name. There are string attributes in these new GL GPU OS devices (lstopo
  GPU L#9 (Backend=GL GPUVendor="NVIDIA Corporation" GPUModel="Tesla
C2050") ":0.2"

2) The gl component is now buildable as a plugin

3) Given (2), we can't expose internal GL routines in the public API. So
hwloc/gl.h is just made of inline helpers as any other hwloc/foo.h. It now
contains functions to convert between displays (name or port/device) and
hwloc OS devices:

hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device(hwloc_topology_t
topology, unsigned port, unsigned device) hwloc_obj_t
topology, const char *name)
int hwloc_gl_get_display_by_osdev(hwloc_topology_t topology, hwloc_obj_t
osdev,unsigned *port, unsigned *device)

If you really need the PCI device, just use osdev->parent as documented.
If you need the locality, use hwloc_get_non_io_ancestor(topology,
See tests/gl.c for examples.

Please review hwloc/gl.h and let me know if that works for you. I hope I
used the words port/device/server/screen as expected.

The last thing on my TODO list is to decide is whether we keep the "GL"
name or switch to something among display/X11/X/... for filenames and
function names.


hwloc-users mailing list