12

The system is setup with one of those hybrid Intel/ATI offerings (muxless). After a bit of fiddling with kernel settings and drivers I got both cards working, I think (adding radeon.dpm=1 in kernel settings and using only the opensource drivers).

However I can't figure out which card the system is using. From my understanding with the newer kernel (3.12) amd dynamic power management will power down/ power up the card when needed, so in theory it should be using the integrated hd4000 for most of the time, however I can't find an easy way to check which one is in use.

lspci | grep VGA only lists all the cards, it doesn't specify which one is currently in use.

Some steering in the right direction much appreciated.

System

Debian 7 stable, 3.12 amd64 Kernel 7670M AMD + Intel HD4000

3 Answers 3

7

xrandr

Using xrandr will show you which cards are available.

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x49 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 8 associated providers: 0 name:Intel

On this system I have 1 graphics card, an Intel, which has 2 ports (outputs). You can see the outputs with xrandr like so:

$ xrandr -q
Screen 0: minimum 320 x 200, current 3360 x 1080, maximum 8192 x 8192
LVDS1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 303mm x 190mm
   1440x900       60.0*+   50.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 connected 1920x1080+1440+0 (normal left inverted right x axis y axis) 521mm x 293mm
   1920x1080      60.0*+
   1680x1050      60.0  
   1280x1024      75.0     60.0  
   1440x900       59.9  
   1280x960       60.0  
   1152x864       75.0  
   1024x768       75.1     70.1     60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1  
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)

The 2 outputs are VGA1 (VGA external port) and LVDS1 (LCD monitor on laptop).

lshw

Lastly you can use lshw to find out more info regarding the actual graphics cards info:

$ sudo lshw -numeric -c video
  *-display               
       description: VGA compatible controller
       product: Core Processor Integrated Graphics Controller [8086:46]
       vendor: Intel Corporation [8086]
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 02
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:41 memory:f2000000-f23fffff memory:d0000000-dfffffff ioport:1800(size=8)

How to determine which GPU is driving which monitors

To accomplish this task you'll need to take the list of providers and note their number from the xrandr --listproviders command. This number is the devices number. It's often times the same number that's assigned along with the screen in the output of xrandr -q.

So one can loosely construct which GPU "device" is driving which screen. In my example "Provider 0" is driving "Screen 0".

NOTE: The term "Screen" does not necessarily correspond to a single display. In my scenario my GPU can drive 2 outputs, LVDS1 and VGA1. But this approach does allow you to make the determination with a fairly high degree of confidence as to which display is being driven by which GPU.

The above associations is controlled through the system's setup so there are possibilities that it could mislead you. For example, the above association is driven from a setup that often looks like this:

Section "Screen"
    Identifier  "Screen0"
    Device      "Device0"
EndSection
Section "Screen"
    Identifier  "Screen1"
    Device      "Device1"
EndSection

So there is the possibility that the system was setup with Screen0 being driven something other than Device0.

References

6
  • I don't have a multi-GPU machine to test with, but as far as I can tell, none of the commands you've proposed indicate which GPU drives which monitor. Commented May 10, 2014 at 11:05
  • @Gilles - true they don't come out and actually state it but they do show how a device is associated to a given screen (i.e. displays).
    – slm
    Commented May 10, 2014 at 22:11
  • You still aren't explaining how to relate a GPU with a monitor (at least in the common case of not having an Xorg.conf). The information is probably in the Xorg log if nowhere else (and probably elsewhere but I have no experience with that). Commented May 11, 2014 at 11:37
  • @Gilles - hmm. The provider "Provider 0" is GPU #0. That GPU drives displays that are associated as "Screen 0". Did I not explain that clearly?
    – slm
    Commented May 11, 2014 at 12:29
  • But how do you know which provider drives which screen? Commented May 11, 2014 at 12:36
3

The glxinfo, which is available in mesa-utils can be used to display which video adapter is used for OpenGL graphics.

For example:

➜  ~  glxinfo | grep "OpenGL renderer string"
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
1

This question still shows up near the top of google results so I will answer it even though it is very old. The response from slm taught me many useful tools, but did not give me the answer. Ubuntu's switch to wayland might be part of the problem. Here's how I figured it out:

    root@Legion5:~# ls -lah /sys/class/drm
total 0
drwxr-xr-x  2 root root    0 Nov  9 11:07 .
drwxr-xr-x 87 root root    0 Nov  9 11:07 ..
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card0 -> ../../devices/pci0000:00/0000:00:08.1/0000:06:00.0/drm/card0
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card0-eDP-1 -> ../../devices/pci0000:00/0000:00:08.1/0000:06:00.0/drm/card0/card0-eDP-1
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card1-DP-1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-DP-1
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card1-DP-2 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-DP-2
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card1-eDP-2 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-eDP-2
lrwxrwxrwx  1 root root    0 Nov  9 11:07 card1-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/card1/card1-HDMI-A-1
lrwxrwxrwx  1 root root    0 Nov  9 11:07 renderD128 -> ../../devices/pci0000:00/0000:00:08.1/0000:06:00.0/drm/renderD128
lrwxrwxrwx  1 root root    0 Nov  9 11:07 renderD129 -> ../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/drm/renderD129
-r--r--r--  1 root root 4.0K Nov  9 11:07 version

this listing shows the card and the display, ie "card0 eDP-1" is my laptops amd gpu controlling the laptop's built in LCD screen. "card1-HDMI-A-1" is the nvida gpu controlling the external display on the HDMI port. Still not perfect but close enough to tell me what I want.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .