[ubuntu-x] Hybrid graphics detection

Evan Broder evan at ebroder.net
Wed Nov 2 17:38:44 UTC 2011

On Wed, Nov 2, 2011 at 11:35 AM, Christopher James Halse Rogers
<chalserogers at gmail.com> wrote:
> On Mon, 2011-10-31 at 11:54 -0700, Bryce Harrington wrote:
>> Thanks Evan
>> On Mon, Oct 31, 2011 at 11:36:39AM -0700, Evan Broder wrote:
>> > At the hybrid graphics session today, we discussed how we could detect
>> > which GPU was actively being used in a hybrid graphics configuration.
>> > I have some code that I've been using to do this, using libpciaccess.
>> >
>> > It's based on the code that X itself uses to pick which drivers to
>> > load at startup, so it likely suffers from some of the issues we
>> > discussed in the session. But it does seem to work for nVidia Optimus,
>> > which is the only hybrid graphics system I have access to.
>> >
> This works for the ati/intel system I now have - or, at least, it
> correctly picks "Integrated" when I've tested it.  It's not possible to
> switch to the radeon card because it's not hooked up to any outputs :)

If you take out the "break" at line 51, does it still only print out

Right now it will only print one or the other, but from the discussion
it sounded like pci_device_is_boot_vga might return true for multiple
devices under certain configurations. It would be nice to know.

More information about the Ubuntu-x mailing list