You are not logged in.

#1 2014-12-17 22:41:38

Baudouin
Member
Registered: 2014-02-26
Posts: 9

AMD and PRIME - discrete GPU slower than integrated one??

Hi everyone!

I'm trying to understand how to use PRIME in order to enable the discrete GPU of my new laptop. I'm following the guidelines in https://wiki.archlinux.org/index.php/PRIME.

$ lspci | grep VGA
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Richland [Radeon HD 8650G]
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Neptune XT [Radeon HD 8970M]

As you can see, I have two AMD cards, and this is where I get confused.

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x8e cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 4 associated providers: 1 name:radeon
Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 1 name:radeon

Both names in xrandr providers are radeon, so in the next command, I don't use the name but the numbers:

xrandr --setprovideroffloadsink 1 0

I do not know if this is the correct way to do it. But when I do it the other way around (ie 0 1) X restarts and everything is buggy as hell.

Then in order to test, I use glxspheres64 with or without DRI_PRIME=1 (I also add vblank_mode=0 to disable vertical synchronisation). Here are the results:

$ glxspheres64 
Polygons in scene: 62464
Visual ID of window: 0x252
Context is Direct
OpenGL Renderer: Gallium 0.4 on AMD ARUBA
59.988515 frames/sec - 66.947183 Mpixels/sec
59.937459 frames/sec - 66.890204 Mpixels/sec
59.437605 frames/sec - 66.332367 Mpixels/sec
$ vblank_mode=0 glxspheres64 
Polygons in scene: 62464
ATTENTION: default value of option vblank_mode overridden by environment.
Visual ID of window: 0x252
Context is Direct
OpenGL Renderer: Gallium 0.4 on AMD ARUBA
152.727412 frames/sec - 170.443792 Mpixels/sec
150.808070 frames/sec - 168.301806 Mpixels/sec
151.490700 frames/sec - 169.063621 Mpixels/sec
$ DRI_PRIME=1 glxspheres64 
Polygons in scene: 62464
libGL error: failed to open drm device: Invalid argument
libGL error: failed to load driver: radeonsi
Visual ID of window: 0x252
Context is Direct
OpenGL Renderer: Gallium 0.4 on llvmpipe (LLVM 3.5, 128 bits)
10.303803 frames/sec - 11.499045 Mpixels/sec
10.546516 frames/sec - 11.769912 Mpixels/sec
10.448792 frames/sec - 11.660852 Mpixels/sec

As you can see, when adding DRI_PRIME=1, supposedly to use the discrete GPU, I get only 10 FPS, whereas on the slow GPU I have 150 FPS. Am I doing things properly? Is there something else I need to do? I see there are libGL errors but I don't know if they are related to the problem and I couldn't find anything on them.
And lastly I'm sure the 150 FPS are from the integrated card and not the discrete card, as this laptop is supposed to be a good gaming platform.

Thanks for any help you can give.

Offline

#2 2014-12-17 23:03:54

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: AMD and PRIME - discrete GPU slower than integrated one??

I do not know if this is the correct way to do it

It is.

libGL error: failed to open drm device: Invalid argument
libGL error: failed to load driver: radeonsi

That's what's cusing the problem: radeon driver failed to load.
Look into logs for why it failed exactly.

Offline

#3 2014-12-18 10:32:23

Baudouin
Member
Registered: 2014-02-26
Posts: 9

Re: AMD and PRIME - discrete GPU slower than integrated one??

Xabre wrote:

I do not know if this is the correct way to do it

It is.

Good to know smile

dmesg gives me this:

[ 1522.669316] [drm] probing gen 2 caps for device 1022:1413 = 700d01/6
[ 1522.669323] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
[ 1522.997483] [drm] PCIE GART of 1024M enabled (table at 0x0000000000276000).
[ 1522.997601] radeon 0000:01:00.0: WB enabled
[ 1522.997604] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000080000c00 and cpu addr 0xffff8800832bac00
[ 1522.997606] radeon 0000:01:00.0: fence driver on ring 1 use gpu addr 0x0000000080000c04 and cpu addr 0xffff8800832bac04
[ 1522.997608] radeon 0000:01:00.0: fence driver on ring 2 use gpu addr 0x0000000080000c08 and cpu addr 0xffff8800832bac08
[ 1522.997610] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000080000c0c and cpu addr 0xffff8800832bac0c
[ 1522.997612] radeon 0000:01:00.0: fence driver on ring 4 use gpu addr 0x0000000080000c10 and cpu addr 0xffff8800832bac10
[ 1522.999223] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000075a18 and cpu addr 0xffffc90010f35a18
[ 1523.489787] [drm:r600_ring_test] *ERROR* radeon: ring 0 test failed (scratch(0x850C)=0xCAFEDEAD)
[ 1523.489792] [drm:si_resume] *ERROR* si startup failed on resume
[ 1523.498798] radeon 0000:01:00.0: couldn't schedule ib
[ 1523.498835] radeon 0000:01:00.0: couldn't schedule ib
[ 1613.680932] radeon 0000:01:00.0: couldn't schedule ib
[ 1613.680972] radeon 0000:01:00.0: couldn't schedule ib

I also added LIBGL_DEBUG=verbose to the command

$ DRI_PRIME=1 LIBGL_DEBUG=verbose glxspheres64
Polygons in scene: 62464
libGL: screen 0 does not appear to be DRI3 capable
libGL error: failed to open drm device: Invalid argument
libGL error: failed to load driver: radeonsi
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/swrast_dri.so
libGL: Can't open configuration file /home/baudouin/.drirc: No such file or directory.
libGL: Can't open configuration file /home/baudouin/.drirc: No such file or directory.
Visual ID of window: 0x252
Context is Direct
OpenGL Renderer: Gallium 0.4 on llvmpipe (LLVM 3.5, 128 bits)
10.892552 frames/sec - 12.156088 Mpixels/sec
11.070561 frames/sec - 12.354746 Mpixels/sec

I'll try to google these errors but I'm no GPU guru, so we'll see what I can find.

Offline

#4 2014-12-18 23:49:19

Baudouin
Member
Registered: 2014-02-26
Posts: 9

Re: AMD and PRIME - discrete GPU slower than integrated one??

In order to be more precise in localising the error, I tried LIBGL_DEBUG when using the integrated GPU.
Without PRIME I get:

libGL: screen 0 does not appear to be DRI3 capable
libGL: pci id for fd 4: 1002:990b, driver r600
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/r600_dri.so
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/r600_dri.so
libGL: Can't open configuration file /home/baudouin/.drirc: No such file or directory.
libGL: Can't open configuration file /home/baudouin/.drirc: No such file or directory.

and with PRIME:

libGL: screen 0 does not appear to be DRI3 capable
libGL error: failed to open drm device: Invalid argument
libGL error: failed to load driver: radeonsi
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/swrast_dri.so
libGL: Can't open configuration file /home/baudouin/.drirc: No such file or directory.
libGL: Can't open configuration file /home/baudouin/.drirc: No such file or directory.

So I guess there are really only 2 errors that need seeing into, namely the DRM device not opening, and radeonsi not loading.

I've seen some fixes (which were not really related to my problem, but well) where you have to modify mkinitcpio. Maybe I can try something like adding "radeon" or "radeonsi" to the MODULES="" line in mkinitcpio.conf?

Is there anybody who knows wether this is a good or a stupid idea? I'll try eventually, but if I can avoid destroying my computer in the process it'd be nice smile

Offline

#5 2014-12-19 14:19:34

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: AMD and PRIME - discrete GPU slower than integrated one??

DRI3 thing is not an issue, DRI3 is disabled in xf86-video-intel currently as it creates issues.

You issue is that radeonsi driver failed to load for some reason. Everything else is related to that.

Adding radeon to nitramfs just enables early loading, but your issue is that it fails to load anyway.

Do you have some leftover X configs, especially if you previously played with Catalyst, maybe?

Oh, right, you have AMD APU, combined with AMD discrete graphics, radeon module should be there in initramfs for early KMS.

Last edited by Xabre (2014-12-19 14:21:39)

Offline

#6 2014-12-19 15:18:33

Baudouin
Member
Registered: 2014-02-26
Posts: 9

Re: AMD and PRIME - discrete GPU slower than integrated one??

I did install Catalyst, but removed it right away because I couldn't get X to start, so maybe I do have some leftover configs. What files should I clean up? I've got nothing in /etc/X11 which seems wrong.

Since yesterday, I have installed systemd-vgaswitcheroo-units, and apparently the discrete card was always unpowered. I deactivated dpm in GRUB and now I have this:

# cat /sys/kernel/debug/vgaswitcheroo/switch 
0:IGD:+:Pwr:0000:00:01.0
1:DIS: :DynPwr:0000:01:00.0

so I think it has power now. Mabe that is part of the issue. But even with this change, I still have the libgl errors.

I also tried adding "radeon" to mkinitcpio.conf. But then xrandr --listproviders gives only one provider, which means I can't use xrandr --setprovideroffloadsink. So either I should not modifiy mkinitcpio or there's something else I need to do if I modify it so that xrandr finds both GPUs.
For now I reverted mkinitcpio back to normal.

Offline

#7 2014-12-19 16:08:44

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: AMD and PRIME - discrete GPU slower than integrated one??

Am really not sure how that works with two Radeon cards (IGP and DGP), since both need to use the same driver. Tried googling a bit, but can't find anything that resembles your problem.
I have intel/ati combo, so can't really test it.
DPM will aways shut down the DGP if it's not used, so that's normal.

Offline

#8 2014-12-19 16:26:09

Baudouin
Member
Registered: 2014-02-26
Posts: 9

Re: AMD and PRIME - discrete GPU slower than integrated one??

Xabre wrote:

Tried googling a bit, but can't find anything that resembles your problem.

Unfortunately, me neither...

Maybe I should try the catalyst driver, with pxp. I've heard good things about Violo's package.

Offline

Board footer

Powered by FluxBB