Any way to disable dGPU

Hi, just wondering if someone knows how to disable the dGPU without “physically remove” it from the laptop.

I want to avoid this scenario where apps and games randomly “detect” and “wakes” my dGPU from D3Cold state.

Also, second question. If I connect an external monitor into dGPU, it activates and works fantastic, but then it becomes impossible to put it back on D3Cold. Anyone knows a good way to send it back to sleep mode?

Which Linux distro are you using?
Gentoo

Which release version?
2.15

Which kernel are you using?
6.10.7-waltercool

Which BIOS version are you using?
03.03

Which Framework Laptop 16 model are you using? (AMD Ryzen™ 7040 Series)
Framework 16 w/Radeon 7700S

I don’t have a dGPU yet (this issue is why I didn’t buy one), but I am interested in following this thread. Have you tried seeing which processes are binding to the dGPU?

If I’m using GPU intensive games or apps, then apps can completely ignore flags like DRI_PRIME, specially if they use protocols like Vulkan.

If I’m using AI related tools, then HIP_VISIBLE_DEVICES should do the job, but actually it doesn’t. It still turns on my dGPU when I need some small LLM.

If I’m connecting my external monitor directly to dGPU for a small performance gain, then Xorg (X11) or kwin (KDE Wayland) will attach your GPU and never release it.

Regarding Vulkan, perhaps this snippet from the Arch forums will help

For DRI_PRIME to work on Vulkan applications vulkan-mesa-layers needs to be installed, as well as lib32-vulkan-mesa-layers for 32 bit applications.

https://wiki.archlinux.org/title/PRIME

Naturally the package names may change for Gentoo.

Oh, it’s not like vulkan apps doesn’t work, it’s the whole opposite. It works fantastic, but Vulkan apps have complete freedom to use whatever they find best.

DRI_PRIME works perfect for OpenGL apps, but there is nothing similar like that for Vulkan apps.

Using games with DXVK (like Proton), you can still use DXVK_FILTER_DEVICE_NAME with the name listed on vulkaninfo, but videogames will still use your dGPU CPU but won’t use VRAM.

Example, playing ESO with DXVK_FILTER_DEVICE_NAME=“AMD Radeon 780M (RADV GFX1103_R1)”

This could be something related to AMD PMC, but not sure.

Still, my concern goes by apps waking up dGPU when not needed. If I don’t want to use dGPU by whatever reason, it should be great to just disable until I want to use it again.