Unable to use AMD graphics card for anything

Hi everyone. I have an HP laptop which has integrated Intel graphics and dGPU from AMD. I installed Manjaro KDE minimal edition two days back. It comes with the open source drivers for my AMD graphics card. When I list all my devices using the command lspci -v, it is able to detect the AMD graphics card. When I try to list hardware using the command sudo lshw, it lists my dGPU. So far, so good.

However, when I use the command xrandr --listproviders, I get only 1 provider, and that is not my dGPU. vulkaninfo also does not list my AMD graphics card, only the integrated graphics card. (I do have the vulkan-radeon package installed.) As such, even when I try to run a command with DRI_PRIME=1 prefix, I am not able to use my dGPU. I have tried to see if my driver was blacklisted for some reason as mentioned in troubleshooting section of PRIME page of arch linux wiki, and it is not. (Sorry for not including the link. The forum does not allow me to do so, probably because my account is new.) I even tried to install the unstable 5.16 linux kernel and the problem persists, so I don’t think it is an issue specific to the current kernel.

In case it helps, I am also not able to access my AMD graphics card using PRIME switching or otherwise in Fedora 35, EndeavorOS and a vanilla installation of arch that I have tried. However, Pop!_OS seems to have no such issues and I can use my AMD graphics card using PRIME switching. That convinced me it is some issue with the configuration and not some problem with my laptop. (Let me know if I am wrong here.)

Has anyone seen a similar issue and has been able to resolve it? Or has any idea what I can do to make my dGPU work? My main reason for using a dGPU is to run some OpenGL and vulkan based applications on the AMD graphics card, and the OpenGL support for AMD graphics cards on Windows is suboptimal.

Thanks a lot in advance.

An update - switching to kernel 5.10.89-1-MANJARO makes the AMD graphics card available for PRIME switching. Not sure if there is some update in a later revision of the kernel. Pop!_OS 21.10 used kernel version 5.15 as well as far as I know.

It would probably be a bit more helpful if you provided some more concrete information, such as the output when you attempt to use DRI_PRIME.

Thanks a lot for taking the time to help me.

On kernel 5.10.89-1-MANJARO:

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 1 name:modesetting
Provider 1: id: 0xcd cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 5 outputs: 0 associated providers: 1 name:AMD Radeon 500 Series @ pci:0000:01:00.0

$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: AMD Radeon 500 Series (POLARIS12, DRM 3.40.0, 5.10.89-1-MANJARO, LLVM 13.0.0)

On 5.15.12-1-MANJARO

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:modesetting
$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (KBL GT2)

I can certainly see the differences there.

Please also include inxi:

System:
  Kernel: 5.15.12-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=4e9833af-6f93-438d-8ae7-a1ee7b297e47 rw quiet
    udev.log_priority=3
  Desktop: KDE Plasma 5.23.4 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP EliteBook 840 G5 v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: HP model: 83B2 v: KBC Version 04.6C.00 serial: <superuser required>
    UEFI: HP v: Q78 Ver. 01.17.00 date: 08/04/2021
Battery:
  ID-1: BAT0 charge: 4.2 Wh (77.8%) condition: 5.4/50.2 Wh (10.8%) volts: 11.1
    min: 11.6 model: Hewlett-Packard Primary type: Li-ion serial: <filter>
    status: Discharging cycles: 1637
Memory:
  RAM: total: 15.48 GiB used: 1.8 GiB (11.6%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i7-8550U bits: 64 type: MT MCP arch: Coffee Lake
    family: 6 model-id: 0x8E (142) stepping: 0xA (10) microcode: 0xEA
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 697 high: 772 min/max: 400/4000 scaling:
    driver: intel_pstate governor: powersave cores: 1: 749 2: 627 3: 700 4: 772
    5: 700 6: 699 7: 633 8: 700 bogomips: 32012
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon
    art avx avx2 bmi1 bmi2 bts clflush clflushopt cmov constant_tsc cpuid
    cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est
    f16c flexpriority flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window
    hwp_epp hwp_notify ibpb ibrs ida intel_pt invpcid invpcid_single lahf_lm
    lm mca mce md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx pae
    pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti
    pts rdrand rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2
    sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust
    tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt
    xsaves xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf
    mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional,
    IBRS_FW, STIBP: conditional, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel UHD Graphics 620 vendor: Hewlett-Packard driver: i915
    v: kernel bus-ID: 00:02.0 chip-ID: 8086:5917 class-ID: 0300
  Device-2: AMD Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
    vendor: Hewlett-Packard driver: amdgpu v: kernel bus-ID: 01:00.0
    chip-ID: 1002:699f class-ID: 0380
  Device-3: Cheng Uei Precision Industry (Foxlink) HP HD Camera type: USB
    driver: uvcvideo bus-ID: 1-9:6 chip-ID: 05c8:0808 class-ID: 0e02
    serial: <filter>
  Display: x11 server: X.org 1.21.1.2 compositor: kwin_x11 driver:
    loaded: modesetting alternate: fbdev,vesa resolution: <missing: xdpyinfo>
  OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.3.2
    direct render: Yes
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl bus-ID: 00:1f.3
    chip-ID: 8086:9d71 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.12-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.42 running: no
Network:
  Device-1: Intel Ethernet I219-V vendor: Hewlett-Packard driver: e1000e
    v: kernel port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15d8 class-ID: 0200
  IF: enp0s31f6 state: down mac: <filter>
  Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel
    bus-ID: 02:00.0 chip-ID: 8086:24fd class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 1-7:4 chip-ID: 8087:0a2b class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 476.94 GiB used: 9.2 GiB (1.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: MZVLB512HAJQ-000H1 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: EXA72H1Q temp: 26.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 54.5 GiB size: 53.35 GiB (97.88%) used: 9.2 GiB (17.2%)
    fs: ext4 dev: /dev/nvme0n1p5 maj-min: 259:5 label: N/A
    uuid: 4e9833af-6f93-438d-8ae7-a1ee7b297e47
  ID-2: /boot/efi raw-size: 510 MiB size: 509 MiB (99.80%)
    used: 292 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p4 maj-min: 259:4 label: N/A
    uuid: CC92-8F97
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/nvme0n1p1 maj-min: 259:1 size: 360 MiB fs: vfat label: SYSTEM
    uuid: 4C5C-2E4F
  ID-2: /dev/nvme0n1p2 maj-min: 259:2 size: 128 MiB fs: <superuser required>
    label: N/A uuid: N/A
  ID-3: /dev/nvme0n1p3 maj-min: 259:3 size: 401.44 GiB fs: ntfs
    label: Windows uuid: 044EA1894EA17458
  ID-4: /dev/nvme0n1p6 maj-min: 259:6 size: 980 MiB fs: ntfs
    label: Windows RE tools uuid: AC6CBC256CBBE86A
  ID-5: /dev/nvme0n1p7 maj-min: 259:7 size: 19.06 GiB fs: ntfs
    label: Recovery Image uuid: 6E209368209335D5
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-1:2 info: Apple Aluminium Keyboard (ANSI) type: Keyboard,HID
    driver: apple,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s power: 300mA
    chip-ID: 05ac:024f class-ID: 0300
  Device-2: 1-2:3 info: HP X500 Optical Mouse type: Mouse
    driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 1.5 Mb/s
    power: 100mA chip-ID: 03f0:0941 class-ID: 0301
  Device-3: 1-7:4 info: Intel Bluetooth wireless interface type: Bluetooth
    driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 8087:0a2b class-ID: e001
  Device-4: 1-8:5 info: Validity Sensors type: <vendor specific> driver: N/A
    interfaces: 1 rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 138a:00ab
    class-ID: ff00 serial: <filter>
  Device-5: 1-9:6 info: Cheng Uei Precision Industry (Foxlink) HP HD Camera
    type: Video driver: uvcvideo interfaces: 4 rev: 2.0 speed: 480 Mb/s
    power: 500mA chip-ID: 05c8:0808 class-ID: 0e02 serial: <filter>
  Hub-2: 2-0:1 info: Super-speed hub ports: 6 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 40.0 C pch: 35.5 C mobo: 30.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 221 Uptime: 3m wakeups: 1 Init: systemd v: 250 tool: systemctl
  Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 1130 lib: 306
  Shell: Bash v: 5.1.12 running-in: konsole inxi: 3.3.12

Oh, and one more:

mhwd -li
$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI


Warning: No installed USB configs!

For Kernel 5.15+ and Radeon RX 500 series:

Thanks a lot for the tip. However, it does not work in my case.

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:modesetting
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
$ cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64 root=UUID=4e9833af-6f93-438d-8ae7-a1ee7b297e47 rw quiet udev.log_priority=3 amdgpu.dc=0

I am actually getting a different error as reported by journalctl.

Jan 21 22:59:47 tlvm-hpelitebook840g5 kernel: amdgpu 0000:01:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring uvd test failed (-110)
Jan 21 22:59:47 tlvm-hpelitebook840g5 kernel: [drm:amdgpu_device_init.cold [amdgpu]] *ERROR* hw_init of IP block <uvd_v6_0> failed -110

Following the solution to a similar issue seen by someone else https://bugzilla.kernel.org/show_bug.cgi?id=206141#c8, I tried to disable the blocks that were giving an error. Then I got a different error.

Jan 23 13:12:43 tlvm-hpelitebook840g5 kernel: [drm:amdgpu_device_init.cold [amdgpu]] *ERROR* disabled ip block: 7 <uvd_v6_0>
Jan 23 13:12:43 tlvm-hpelitebook840g5 kernel: [drm:amdgpu_device_init.cold [amdgpu]] *ERROR* disabled ip block: 8 <vce_v3_0>

In this case, using xrandr --listproviders lists two providers, but neither of them is the AMD graphics card and DRI_PRIME=1 still fails to work.

Is there anything else that I can try to solve this issue?

I have no idea.
Just keep Kernel 5.10 if it works with that.

Yeah, I am using the kernel 5.10 for now, but I’d really rather solve this issue and use the latest kernel.

Thanks a lot for your help.

Looking at some other kernel parameters, I found from AMD RX480 amdgpu, drm, no video at modeset / Kernel & Hardware / Arch Linux Forums that adding amdgpu.dpm=0 kernel parameter allowed the detection of the dGPU. I can use DRI_PRIME=1 successfully. So I guess that’s a win.

However, the performance after using it is absolutely horrible; to the point that the integrated Intel GPU performs better. Using the benchmarking tool basemark, the score went from ~9700 (on kernel 5.10) down to ~2600 (on kernel 5.15 with this workaround). So, yeah, this workaround doesn’t really help to solve the problem.

Yes, amdgpu.dpm as Display power management is important for performance of GPU.