How to turn off discrete GPU Radeon?

My setup Lenovo Legion 5 with AMD 5600 and Radeon RX 6600, manjaro xfce 6.6.26-1 kernel.
For now i have a problem that my battery discharged for 1.5h.
I have priority for my graphics cards but it isn’t solved my problem. All topics here are recomended try Optimus and bumblebee. But its for green cards. What about Radeon? thanks for answers to everyone.

Hi and welcome,

Maybe begin with some system information.

inxi -Farz
mhwd -li -l

This guide also has tips like how to format code, etc.

2 Likes

mhwd -li -l

 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

xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x53 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:AMD Radeon Graphics @ pci:0000:07:00.0
Provider 1: id: 0x88 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 5 outputs: 4 associated providers: 1 name:AMD Radeon RX 6600M @ pci:0000:03:00.0

I would take a look at the actual power draw and if the discrete GPU is running at all or just suspended.

pamac install powertop
sudo powertop --html
firefox powertop.html

Probably take a look at: VGA Switcheroo — The Linux Kernel documentation and here is a service which does it: [SOLVED] How to set vgaswitcheroo mode to IGD at boot time? / Kernel & Hardware / Arch Linux Forums

# /etc/systemd/system/switchtoIGPU.service
[Unit]
Description=Switching to igpu service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/sh -c "sleep 5 && echo IGD>/sys/kernel/debug/vgaswitcheroo/switch"
[Install]
WantedBy=multi-user.target

DIGD: Delayed switch to the integrated graphics device. This will perform the switch once the last user space process has closed the device files of the GPUs and the audio client.

I can stop pci devices like this?

echo 1 > /sys/bus/pci/devices/id/remove

Not exactly, take a look here:

Removing a device from the kernel list of recognized devices is not the same as powering it off. Plus that is very hardware depended although linux supports that. If you want to try, do it.

For example you run lspci. On the left side you see the Addresses. If it is 00:02.0, then it is this path:

/sys/devices/pci0000\:00/0000\:00\:02.0/

at the folder power you see some files, like control. Here you get an overview:

$ find /sys/devices/pci0000\:00/0000\:00\:02.0/power/ -type f -printf '%P -> ' -exec cat {} \;
runtime_active_time -> 277918522
runtime_status -> active
autosuspend_delay_ms -> 10000
runtime_suspended_time -> 4687662
control -> auto

Usually it will be suspended (powered off) after 10000ms, so after 10sec not in use, if the driver support it and driver’s power management was not disabled by the user via kernel parameter or APM/ACPI.

So it is really hard to believe that your discrete GPU sucks the battery power, when you don’t use it. :man_shrugging:

Most of the time it’s an internal USB connection like a fancy LED keyboard or an audio card, which then drains the battery.

if i have adress like this

03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 23 [Radeon RX 6600/6600 XT/6600M] (rev c3)

i need to check /sys/devices/pci0000\:00/0000\:03\:00.0/ ?

1 Like

Yes, you can assume that.