System freezes when using prime

I use a dual-gpu laptop and when I try to run apps using DRI_PRIME=1 the system freezes (except I can move the cursor for some reason) and I have to reset the system manually. It seem to affect only some apps (like steam or glxgears) and being fine with others (some videogames).

Any way I can fix this?

System info:

System:
  Kernel: 5.15.7-1-rt23-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-rt-x86_64
    root=UUID=584e4a68-ed04-42c2-892d-f3f6f50f3761 rw quiet apparmor=1
    security=apparmor resume=UUID=a4a9ed97-abcd-4b36-bb0b-1e236d350a31
    udev.log_priority=3 radeon.runpm=0
  Desktop: Xfce 4.16.0 tk: Gtk 3.24.29 info: xfce4-panel wm: xfwm 4.16.1
    dm: LightDM 1.30.0 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP Laptop 15-bw0xx v: Type1ProductConfigId
    serial: <filter> Chassis: type: 10 serial: <filter>
  Mobo: HP model: 8331 v: 27.35 serial: <filter> UEFI: Insyde v: F.52
    date: 12/03/2019
Memory:
  RAM: total: 7.24 GiB used: 1.71 GiB (23.6%)
  Array-1: capacity: 64 GiB slots: 2 EC: None max-module-size: 32 GiB
    note: est.
  Device-1: Bottom-slot 1(left) size: No Module Installed
  Device-2: Bottom-slot 2(right) size: 8 GiB speed: 1866 MT/s type: DDR4
    detail: synchronous unbuffered (unregistered) bus-width: 64 bits
    total: 64 bits manufacturer: Hynix part-no: HMA81GS6AFR8N-UH
    serial: <filter>
CPU:
  Info: model: AMD A9-9420 RADEON R5 5 COMPUTE CORES 2C+3G socket: FP4
    bits: 64 type: MCP arch: Excavator family: 0x15 (21) model-id: 0x70 (112)
    stepping: 0 microcode: 0x6006705
  Topology: cpus: 1x cores: 2 smt: <unsupported> cache: L1: 192 KiB
    desc: d-2x32 KiB; i-2x64 KiB L2: 2 MiB desc: 2x1024 KiB
  Speed (MHz): avg: 1900 high: 2400 min/max: 1400/3000 boost: enabled
    base/boost: 3000/3000 scaling: driver: acpi-cpufreq governor: schedutil
    volts: 1.1 V ext-clock: 100 MHz cores: 1: 2400 2: 1400 bogomips: 11977
  Flags: 3dnowprefetch abm acc_power aes aperfmperf apic arat avic avx avx2
    bmi1 bmi2 bpext clflush cmov cmp_legacy constant_tsc cpb cpuid cr8_legacy
    cx16 cx8 de decodeassists extapic extd_apicid f16c flushbyasid fma fma4
    fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb ibs lahf_lm lbrv lm lwp mca
    mce misalignsse mmx mmxext monitor movbe msr mtrr mwaitx nodeid_msr
    nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae pat pausefilter
    pclmulqdq pdpe1gb perfctr_core perfctr_nb pfthreshold pge pni popcnt pse
    pse36 ptsc rdtscp rep_good sep skinit smep ssbd sse sse2 sse4_1 sse4_2
    sse4a ssse3 svm svm_lock syscall tbm tce tsc tsc_scale v_vmsave_vmload
    vgif vmcb_clean vme vmmcall wdt xop xsave xsaveopt
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  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 AMD retpoline, IBPB: conditional, STIBP:
    disabled, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Stoney [Radeon R2/R3/R4/R5 Graphics] vendor: Hewlett-Packard
    driver: amdgpu v: kernel bus-ID: 00:01.0 chip-ID: 1002:98e4 class-ID: 0300
  Device-2: AMD Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 /
    Radeon 520 Mobile]
    vendor: Hewlett-Packard driver: radeon v: kernel alternate: amdgpu
    bus-ID: 01:00.0 chip-ID: 1002:6660 class-ID: 0380
  Device-3: Cheng Uei Precision Industry (Foxlink) HP Webcam type: USB
    driver: uvcvideo bus-ID: 2-1:2 chip-ID: 05c8:0233 class-ID: 0e02
    serial: <filter>
  Display: server: X.Org 1.21.1.2 compositor: xfwm4 v: 4.16.1 driver:
    loaded: ati,radeon unloaded: amdgpu,modesetting alternate: fbdev,vesa
    display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2")
    s-diag: 582mm (22.9")
  Monitor-1: HDMI-A-0 res: 1920x1080 hz: 60 dpi: 102
    size: 477x268mm (18.8x10.6") diag: 547mm (21.5")
  OpenGL:
    renderer: AMD STONEY (DRM 3.42.0 5.15.7-1-rt23-MANJARO LLVM 13.0.0)
    v: 4.5 Mesa 21.3.2 direct render: Yes
Audio:
  Device-1: AMD vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    bus-ID: 00:01.1 chip-ID: 1002:15b3 class-ID: 0403
  Device-2: AMD Family 15h Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel bus-ID: 00:09.2 chip-ID: 1022:157a
    class-ID: 0403
  Sound Server-1: ALSA v: k5.15.7-1-rt23-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: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel port: 3000 bus-ID: 02:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  Device-2: Realtek RTL8723DE 802.11b/g/n PCIe Adapter
    vendor: Hewlett-Packard driver: rtw_8723de v: N/A modules: rtw88_8723de
    port: 2000 bus-ID: 03:00.0 chip-ID: 10ec:d723 class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Realtek Realtek Bluetooth 4.2 Adapter type: USB driver: btusb
    v: 0.8 bus-ID: 1-1.4:3 chip-ID: 0bda:b009 class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 1 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: 465.76 GiB used: 141.03 GiB (30.3%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Toshiba model: MQ01ABF050
    size: 465.76 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 5400 serial: <filter> rev: 4C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 457.74 GiB size: 449.48 GiB (98.20%)
    used: 141.03 GiB (31.4%) fs: ext4 block-size: 4096 B dev: /dev/sda3
    maj-min: 8:3 label: N/A uuid: 584e4a68-ed04-42c2-892d-f3f6f50f3761
  ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 288 KiB (0.1%) fs: vfat block-size: 512 B dev: /dev/sda1 maj-min: 8:1
    label: NO_LABEL uuid: 2656-63D7
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 7.52 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/sda2 maj-min: 8:2 label: N/A
    uuid: a4a9ed97-abcd-4b36-bb0b-1e236d350a31
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: Full speed or root hub ports: 2 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 1-1:2 info: Advanced Micro Devices Root Hub ports: 4 rev: 2.0
    speed: 480 Mb/s power: 100mA chip-ID: 0438:7900 class-ID: 0900
  Device-1: 1-1.4:3 info: Realtek Realtek Bluetooth 4.2 Adapter
    type: Bluetooth driver: btusb interfaces: 2 rev: 1.1 speed: 12 Mb/s
    power: 500mA chip-ID: 0bda:b009 class-ID: e001 serial: <filter>
  Hub-3: 2-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 2-1:2 info: Cheng Uei Precision Industry (Foxlink) HP Webcam
    type: Video driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s
    power: 500mA chip-ID: 05c8:0233 class-ID: 0e02 serial: <filter>
  Device-2: 2-2:3
    info: SHARKOON 2.4GHz Wireless rechargeable vertical mouse [More&Better]
    type: Mouse driver: hid-generic,usbhid interfaces: 1 rev: 1.1
    speed: 12 Mb/s power: 100mA chip-ID: 1ea7:0064 class-ID: 0301
  Hub-4: 3-0:1 info: Super-speed hub ports: 4 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 55.0 C mobo: 20.0 C
  Fan Speeds (RPM): N/A
  GPU: device: radeon temp: 39.0 C device: amdgpu temp: 54.0 C
Info:
  Processes: 218 Uptime: 30m wakeups: 1 Init: systemd v: 250 tool: systemctl
  Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 1430 lib: 479
  flatpak: 0 Shell: Bash (sudo) v: 5.1.12 running-in: xfce4-terminal
  inxi: 3.3.11

Hi @SendHelp. and welcome!

That, indeed, sounds peculiar.

Please provide the output for:

sudo mhwd --list

as well as

sudo mhwd --listavailable

And

sudo lspci

*PHEW*

I think that’s it!

Edit:

Nope. It wasn’t. Also see [HowTo] Provide System Information and [HowTo] post screenshots and links if and where applicable.

That second one is probably a typo?

But we would also probably get best info from

mhwd -l -d

Which would show us both installed and available.


Is there a reason you are using the Realtime kernel? Such as audio engineering?
If not, I would recommend using the regular 5.15 (or others like 5.10) kernel.

Fixed, thanks! Comes from being interrupted.

mhwd -l -d:

--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI


> 0000:00:01.0 (0300:1002:98e4) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:01:00.0 (0380:1002:6660) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI

mhwd -l -d:

--------------------------------------------------------------------------------
> PCI Device: /devices/pci0000:00/0000:00:02.2/0000:02:00.0 (0200:10ec:8168)
  Network controller Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
--------------------------------------------------------------------------------
  > AVAILABLE:

   NAME:	network-r8168
   ATTACHED:	PCI
   VERSION:	2016.04.20
   INFO:	RealTek RTL-8168 Gigabit Ethernet driver
   PRIORITY:	0
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0200 
   VENDORIDS:	1186 10ec 


--------------------------------------------------------------------------------
> PCI Device: /devices/pci0000:00/0000:00:01.0 (0300:1002:98e4)
  Display controller ATI Technologies Inc Stoney [Radeon R2/R3/R4/R5 Graphics]
--------------------------------------------------------------------------------
  > INSTALLED:

   NAME:	video-linux
   ATTACHED:	PCI
   VERSION:	2018.05.04
   INFO:	Standard open source drivers.
   PRIORITY:	2
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0300 0380 0302 
   VENDORIDS:	1002 8086 10de 



  > AVAILABLE:

   NAME:	video-linux
   ATTACHED:	PCI
   VERSION:	2018.05.04
   INFO:	Standard open source drivers.
   PRIORITY:	2
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0300 0380 0302 
   VENDORIDS:	1002 8086 10de 

   NAME:	video-modesetting
   ATTACHED:	PCI
   VERSION:	2020.01.13
   INFO:	X.org modesetting video driver.
   PRIORITY:	1
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0300 
   VENDORIDS:	* 

   NAME:	video-vesa
   ATTACHED:	PCI
   VERSION:	2017.03.12
   INFO:	X.org vesa video driver.
   PRIORITY:	0
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0300 
   VENDORIDS:	* 


--------------------------------------------------------------------------------
> PCI Device: /devices/pci0000:00/0000:00:02.1/0000:01:00.0 (0380:1002:6660)
  Display controller ATI Technologies Inc Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile]
--------------------------------------------------------------------------------
  > INSTALLED:

   NAME:	video-linux
   ATTACHED:	PCI
   VERSION:	2018.05.04
   INFO:	Standard open source drivers.
   PRIORITY:	2
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0300 0380 0302 
   VENDORIDS:	1002 8086 10de 



  > AVAILABLE:

   NAME:	video-linux
   ATTACHED:	PCI
   VERSION:	2018.05.04
   INFO:	Standard open source drivers.
   PRIORITY:	2
   FREEDRIVER:	true
   DEPENDS:	-
   CONFLICTS:	-
   CLASSIDS:	0300 0380 0302 
   VENDORIDS:	1002 8086 10de 


Warning: no configs for USB devices found!

Sudo lspci:

00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) I/O Memory Management Unit
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Stoney [Radeon R2/R3/R4/R5 Graphics] (rev da)
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 15b3
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Host Bridge
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Host Bridge
00:08.0 Encryption controller: Advanced Micro Devices, Inc. [AMD] Carrizo Platform Security Processor
00:09.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Carrizo Audio Dummy Host Bridge
00:09.2 Audio device: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Audio Controller
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 20)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 4b)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 49)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 4b)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney HT Configuration
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney Address Maps
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney DRAM Configuration
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney Miscellaneous Configuration
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney PM Configuration
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney NB Performance Monitor
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] (rev 83)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723DE 802.11b/g/n PCIe Adapter

sudo mhwd --listavailable outputs invalid otion.

The reason for realtime kernel is that it’s the only one cdemu works on and I forgot to switch back to the regular.

I switched to regular 5.15 kenel and now it no longer causes freezes. Now when I try to launch
DRI_PRIME=1 glxgears_pixmap
the terminal outputs this:

radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    va        : 0x0000000100000000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x100000000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    va        : 0x0000000100000000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x100000000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    va        : 0x0000000100000000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x100000000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    va        : 0x0000000100000000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x100000000
radeonsi: Failed to create a context.
Error: glXCreateNewContext failed

This card isnt using amdgpu.
That could be one of the problems.
It is a sea island card, if my search engine is correct.

Please install amdgpu-experimental, which should take care of allowing the sea-island to use amdgpu, and report back.

Note - See the archwiki for more in-depth information, though again, the above package should take care of things.
https://wiki.archlinux.org/title/AMDGPU#Enable_Southern_Islands_(SI)_and_Sea_Islands_(CIK)_support

I installed the drier and it seems to be in use
lspci -k:

01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] (rev 83)
	Subsystem: Hewlett-Packard Company Device 8331
	Kernel driver in use: amdgpu
	Kernel modules: radeon, amdgpu

But the issue still persists (but now it loads again). Also the freezing is back.

Update:
I found out that running any game with or without prime now causes freezes.

After that, I tried to switch to 5.4 kernel and it kind of worked. Gears no longer freeze but they output about 1800fps on average with prime as opposed to 3600fps on average without prime. Also the wifi does not work.

Looks like using kernel 5.4 is the only solution for the time being.

This makes some amount of sense given the older card.

You are also in the somewhat odd position of having a more modern APU than your older, but previously more powerful, with much older GCN architecture, standalone card.

Now the situation is even more odd. I tried to run a game. with prime=1 mangohud shows 0% gpu load, 45% cpu load and 60 fps. With prime=1 100% gpu, 25% cpu and only 44 fps.

(I just in case ran glxgears -info and confirmed that 0 is indeed integrated and 1 is dedicated)

I don’t get it.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.