You are not logged in.

#1 2022-09-19 08:14:33

sodamouse
Member
Registered: 2022-09-19
Posts: 33

[SOLVED] How to use discrete AMD gpu on laptop?

I've searched around to find a solution for this but have been unable so far. My Thinkpad E15 has both an integrated intel and discrete AMD Rx 640 GPU, however I have not been able to use the latter for anything. Whenever I use GPU-intensive applications, it is always the intel chip that is being used.

I have all open-source drivers installed.

The output of

xrandr --listproviders

is:

Provider 0: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:modesetting
Provider 1: id: 0xe2 cap: 0x5, Source Output, Source Offload crtcs: 5 outputs: 0 associated providers: 1 name:modesetting

using

xrandr --setprovideroffloadsink 0xe2 0x45

or

xrandr --setprovideroffloadsink 1 0

does nothing.

I've also looked into using PRIME and hybrid stuff but no luck. All suggestions are appreciated.

Last edited by sodamouse (2022-09-20 06:05:17)

Offline

#2 2022-09-19 09:31:08

jonno2002
Member
Registered: 2016-11-21
Posts: 688

Re: [SOLVED] How to use discrete AMD gpu on laptop?

rx640 is gcn4 so you need the amdgpu driver which is explained here: https://wiki.archlinux.org/title/AMDGPU
and to use it you use prime: https://wiki.archlinux.org/title/PRIME

which sounds like what youve been trying to do but it doesnt seem to be working.

what specifically have you installed ? "all open source drivers" doesnt really tell us much

can you post an xorg log ?
also the output of 'lspci -vv'
and i guess "sudo dmesg" as well

Offline

#3 2022-09-19 09:50:04

sodamouse
Member
Registered: 2022-09-19
Posts: 33

Re: [SOLVED] How to use discrete AMD gpu on laptop?

Thanks for the reply. I installed the following packages as suggested by the AMDGPU page:
amdvlk
lib32-amdvlk
xf86-video-amdgpu
lib32-vulkan-icd-loader
vulkan-headers
vulkan-icd-loader
vulkan-intel
vulkan-radeon
lib32-mesa
libva-mesa-driver
mesa
mesa-utils

And I tried the GPU offloading instructions under PRIME

can you post an xorg log ?
https://hastebin.com/enayagazoj.yaml

also the output of 'lspci -vv'

00:02.0 VGA compatible controller: Intel Corporation CometLake-U GT2 [UHD Graphics] (rev 02) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Device 507a
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 126
        Region 0: Memory at c1000000 (64-bit, non-prefetchable) [size=16M]
        Region 2: Memory at a0000000 (64-bit, prefetchable) [size=256M]
        Region 4: I/O ports at 4000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915


03:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa [Radeon 540X/550X/630 / RX 640 / E9171 MCM] (rev c0)
        Subsystem: Lenovo Device 507a
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 138
        Region 0: Memory at b0000000 (64-bit, prefetchable) [size=256M]
        Region 2: Memory at c0000000 (64-bit, prefetchable) [size=2M]
        Region 4: I/O ports at 3000 [size=256]
        Region 5: Memory at c2200000 (32-bit, non-prefetchable) [size=256K]
        Expansion ROM at c2240000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu

and i guess "sudo dmesg" as well
https://hastebin.com/belaquzudo.yaml

Offline

#4 2022-09-19 11:03:45

jonno2002
Member
Registered: 2016-11-21
Posts: 688

Re: [SOLVED] How to use discrete AMD gpu on laptop?

i dont see any obvious problems, xorg has chosen the modesetting driver instead of intel and amdgpu ddx drivers but all the documentation says that modesetting driver is fine

what output do you get from this:

DRI_PRIME=1 glxinfo | grep "OpenGL renderer"

Offline

#5 2022-09-19 11:17:41

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,018

Re: [SOLVED] How to use discrete AMD gpu on laptop?

amdvlk
lib32-amdvlk

Remove those 2, for 99.9% of users / applications vulkan-radeon works better.

[    41.644] (==) Using config directory: "/etc/X11/xorg.conf.d"

[    41.646] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[    41.646] (**) |   |-->Device "integrated"

Looks like you may have some non-standard *.conf files in /etc/X11/xorg.conf.d folder .
please post their contents as well as the output jonno2002 asked for .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2022-09-19 12:22:29

sodamouse
Member
Registered: 2022-09-19
Posts: 33

Re: [SOLVED] How to use discrete AMD gpu on laptop?

I managed to get my card to be used using DRI_PRIME=1, however for steam games, it only works after 1) shutting down steam completely 2)  launching the games directly from their executable and prepending the variable. This means that steam itself needs to be ran through the game's executable. Running Steam with DRI_PRIME=1 and launching games afterwards does not work. If steam is already running, running a game through its executable with DRI_PRIME=1 prepended does not work either.

Last edited by sodamouse (2022-09-19 12:24:59)

Offline

#7 2022-09-19 12:40:11

jonno2002
Member
Registered: 2016-11-21
Posts: 688

Re: [SOLVED] How to use discrete AMD gpu on laptop?

ok so it does work then ? can you still post the output i asked for anyway.

as for launching steam games you need to set launch options: https://wiki.archlinux.org/title/Steam#Launch_options

and you would use

DRI_PRIME=1 %command%

Offline

#8 2022-09-19 14:04:32

sodamouse
Member
Registered: 2022-09-19
Posts: 33

Re: [SOLVED] How to use discrete AMD gpu on laptop?

Yes it works but in the strange way I described, where Steam must necessarily be terminated and launched through a game's exe. The output of the command is the AMD card. I can't post it right now but I checked it before.

Offline

#9 2022-09-20 04:06:43

sodamouse
Member
Registered: 2022-09-19
Posts: 33

Re: [SOLVED] How to use discrete AMD gpu on laptop?

OpenGL renderer string: AMD Radeon 550X Series (polaris12, LLVM 14.0.6, DRM 3.47, 5.19.9-arch1-1)

Offline

#10 2022-09-20 04:07:36

sodamouse
Member
Registered: 2022-09-19
Posts: 33

Re: [SOLVED] How to use discrete AMD gpu on laptop?

This thread should be marked [Solved]

Offline

Board footer

Powered by FluxBB