steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

How to use intel gpu for the client.

Open alexzk1 opened this issue 2 years ago • 5 comments

Your system information

Steam Beta Branch: Steam Beta Update Steam Version: 1731716808 Steam Client Build Date: Sat, Nov 16 00:15 UTC -08:00 Steam Web Build Date: Sat, Nov 16 02:11 UTC -08:00 Steam API Version: SteamClient021 Arch linux GPU: Intel + NVIDIA

Not so long ago steam GUI client started to use NVIDIA gpu (which I see by hardware led ON). GPU intensive games start to lag 10-20 mins heavy. Before that I had ALL GUI apps running on Intel and games only were using nvidia prime. So question is how to revert this back and enforce this fancy store to use Intel GPU ? I tried things like

PrefersNonDefaultGPU=false
X-KDE-RunOnDiscreteGpu=false

And it didn't work. P.S. would be great if steam completely unloads it's GUI when game is started as I could do 2 years ago.

alexzk1 avatar Nov 17 '24 00:11 alexzk1

This script releases nvidia GPU (led is immediately off):

NAME=steamwebhelper
HELPER=/home/alex/.local/share/Steam/ubuntu12_64/$NAME

chmod -x $HELPER
killall -9 $NAME

Reverse script turns it back on. So it seems webhelper enumerates GPUs and keeps it ON. This is bad. Because it is extra electricity for nothing, if I forgot to turn off steam before sleep, it will be full game price during the 1 month.

alexzk1 avatar Nov 17 '24 01:11 alexzk1

Probably we need more tests, but I just run "TESO" for a hour, usually it was stuttering in 20-30 mins last couple weeks. Once I killed steam by script above, all is perfect as it was before. Please, revise how you use GPUs. It is critical on laptops and/or on GPUs with low memory like 4Gbs.

alexzk1 avatar Nov 17 '24 02:11 alexzk1

So what I see here, GPU process image Opens files related to nvidia on sysfs: image And this powers ON dedicated card, which is bad for temperature, power consumption etc on laptop. Unacceptable to waste my resources in such way :/ Also I turned OFF ALL switches into "interface" settings.

alexzk1 avatar Dec 09 '24 02:12 alexzk1

Update, fixed issue using chatGPT and apparmor, the rule is:

/home/alex/.local/share/Steam/ubuntu12_64/steamwebhelper {
    # Запрет на доступ ко всем устройствам NVIDIA
    deny /dev/nvidia0 rw,
    deny /dev/nvidiactl rw,
    deny /dev/nvidia-modeset rw,
    deny /dev/nvidia-uvm rw,
    deny /dev/nvidia-uvm-tools rw,
    deny /dev/nvidia-caps/* rw,

    # Разрешить всё остальное
    file,
    network,
    capability,
    signal peer=steam,
    signal peer=unconfined,
    signal peer=/home/alex/.local/share/Steam/ubuntu12_64/steamwebhelper,
}
  • Change path to what you have there in fact. ** Deny list in full you can get by doing ls -l /dev/nvid*

alexzk1 avatar Dec 09 '24 10:12 alexzk1

Same symptom on current drivers, with a narrower cause. The dGPU no longer stays on, but every Steam start powers it up for ~20 s (runtime PM suspends it again afterwards).

Traced with the kernel's rpm_resume tracepoint (stack trace on resume). Two separate readers of the dGPU's PCI config space, each one enough to resume it:

pread64 -> kernfs_fop_read_iter -> pci_read_config -> pci_config_pm_runtime_get -> rpm_resume
  1. The client runs lspci -mm -n at startup (the string is in steamclient.so, steamui.so and vgui2_s.so). lspci reads every device's config space.
  2. About 1 s later, the steamwebhelper zygote (inside the runtime container) does the same read. Probably Chromium's GPU info collection: libcef.so dlopens libpci.so.3.

The cached sysfs attributes (/sys/bus/pci/devices/*/{class,vendor,device,revision,subsystem_vendor,subsystem_device}) have the same data and don't wake a suspended device. A sysfs-only stand-in for lspci -mm -n gave byte-identical output here and left the dGPU suspended; with it in place, (2) alone still woke the card.

Setup: ASUS ROG Zephyrus G16 (GU605CP), Intel Arc 140T + RTX 5070 Laptop (hybrid, runtime PM auto), Arch-based (Omarchy), kernel 7.2.5, nvidia-open 610.57.04, Steam 1788652215, Steam started with the iGPU env (__GLX_VENDOR_LIBRARY_NAME=mesa, VK_DRIVER_FILES = Intel ICD only).

(Traced with help from an AI assistant; I checked the results on my machine.)

sergihrs avatar Oct 11 '26 19:10 sergihrs