AMD discrete GPU always on with PRIME

Hello everyone,
I have a laptop with AMD 4800H and its integrated GPU, plus a discrete RX5600M.
Unfortunately, the DGPU is always on (even without any DE loaded) and this greatly worsens temperature and battery life.
Flipping the flag in vgaswitcheroo has no effect and the card has always DynPwr set.
I noted that DIS-Audio is connected and I think this could be the reason; since I don’t use HDMI/DP audio output, I tried to disable it entirely by putting in kernel cmdline, but it seems not having any effect too.
I also tried putting amdgpu.runpm=0, hoping that I could set the power state later, but it does not work.
Any ideas about how to sort it out is appreciated!

  Kernel: 5.10.15-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.1 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 
  root=UUID=5b98cae0-81a5-4685-960e-36049a3008dc rw quiet udev.log_priority=3 
  Desktop: KDE Plasma 5.20.5 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM 
  Distro: Manjaro Linux 
  Type: Laptop System: Micro-Star product: Alpha 15 A4DEK v: REV:1.0 
  serial: <filter> Chassis: type: 10 serial: <filter> 
  Mobo: Micro-Star model: MS-16UK v: REV:1.0 serial: <filter> 
  UEFI: American Megatrends v: E16UKAMS.101 date: 07/28/2020 
  ID-1: BAT1 charge: 61.5 Wh condition: 62.6/65.7 Wh (95%) volts: 12.4/10.8 
  model: MSI Corp. MS-16UK type: Li-ion serial: N/A status: Unknown 
  Info: 8-Core model: AMD Ryzen 7 4800H with Radeon Graphics bits: 64 
  type: MT MCP arch: Zen 2 family: 17 (23) model-id: 60 (96) stepping: 1 
  microcode: 8600104 L2 cache: 4 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 92657 
  Speed: 1397 MHz min/max: 1400/2900 MHz boost: enabled Core speeds (MHz): 
  1: 1397 2: 1397 3: 1397 4: 1393 5: 1397 6: 1397 7: 1397 8: 1396 9: 1397 
  10: 1396 11: 1397 12: 1396 13: 1397 14: 1396 15: 1396 16: 1397 
  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, IBRS_FW, 
  STIBP: conditional, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
  Device-1: AMD Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 
  vendor: Micro-Star MSI driver: amdgpu v: kernel bus ID: 03:00.0 
  chip ID: 1002:731f class ID: 0380 
  Device-2: AMD Renoir vendor: Micro-Star MSI driver: amdgpu v: kernel 
  bus ID: 08:00.0 chip ID: 1002:1636 class ID: 0300 
  Device-3: Chicony HD Webcam type: USB driver: uvcvideo bus ID: 1-4:3 
  chip ID: 04f2:b695 class ID: 0e02 
  Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: 
  loaded: amdgpu,ati unloaded: modesetting,radeon alternate: fbdev,vesa 
  display ID: :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: eDP res: 1920x1080 hz: 144 dpi: 142 size: 344x193mm (13.5x7.6") 
  diag: 394mm (15.5") 
  OpenGL: renderer: AMD RENOIR (DRM 3.40.0 5.10.15-1-MANJARO LLVM 11.0.1) 
  v: 4.6 Mesa 20.3.4 direct render: Yes 
  Device-1: AMD Navi 10 HDMI Audio vendor: Micro-Star MSI 
  driver: snd_hda_intel v: kernel bus ID: 03:00.1 chip ID: 1002:ab38 
  class ID: 0403 
  Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor 
  vendor: Micro-Star MSI driver: N/A 
  alternate: snd_pci_acp3x, snd_rn_pci_acp3x bus ID: 08:00.5 
  chip ID: 1022:15e2 class ID: 0480 
  Device-3: AMD Family 17h HD Audio vendor: Micro-Star MSI 
  driver: snd_hda_intel v: kernel bus ID: 08:00.6 chip ID: 1022:15e3 
  class ID: 0403 
  Sound Server: ALSA v: k5.10.15-1-MANJARO 
  Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus ID: 04:00.0 
  chip ID: 8086:2723 class ID: 0280 
  IF: wlp4s0 state: up mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Micro-Star MSI driver: r8169 v: kernel port: f000 bus ID: 05:00.0 
  chip ID: 10ec:8168 class ID: 0200 
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8 bus ID: 3-3:3 
  chip ID: 8087:0029 class ID: e001 
  Message: Required tool hciconfig not installed. Check --recommends 
  Local Storage: total: 476.94 GiB used: 142.66 GiB (29.9%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Kingston model: OM8PCP3512F-AI1 
  size: 476.94 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 serial: <filter> rev: ECFK52.8 temp: 26.9 C 
  ID-1: / raw size: 30 GiB size: 29.4 GiB (98.01%) used: 20.73 GiB (70.5%) 
  fs: ext4 dev: /dev/nvme0n1p8 maj-min: 259:8 
  ID-2: /home raw size: 151 GiB size: 147.63 GiB (97.77%) 
  used: 121.93 GiB (82.6%) fs: ext4 dev: /dev/nvme0n1p9 maj-min: 259:9 
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 4 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/nvme0n1p7 maj-min: 259:7 
  System Temperatures: cpu: 46.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
  GPU: device: amdgpu temp: 39.0 C mem: 0.0 C fan: 65535 watts: 10.00 
  device: amdgpu temp: 37.0 C 
  Processes: 365 Uptime: 23m wakeups: 1 Memory: 15.1 GiB 
  used: 2.67 GiB (17.7%) Init: systemd v: 247 Compilers: gcc: 10.2.0 
  clang: 11.0.1 Packages: pacman: 1420 lib: 473 Shell: Bash v: 5.1.0 
  running in: yakuake inxi: 3.3.00

Ok, I found a workaround, not a proper solution, in arch forum (sorry but I can’t find the link anymore…).
First, disable HDMI audio capability, then switch off the discrete card:

cat /sys/kernel/debug/vgaswitcheroo/switch 
0:DIS-Audio: :DynPwr:0000:03:00.1
1:DIS: :DynPwr:0000:03:00.0

echo 1 > /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:02:00.0/0000:03:00.1/remove
echo "DynOff" > /sys/kernel/debug/vgaswitcheroo/switch

Obviously, the first step has to be adapted to specific configuration.

1 Like

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