You are not logged in.

#1 Yesterday 03:05:09

Sparronator9999
Member
Registered: Yesterday
Posts: 1

NVIDIA GPU not staying/returning to D3cold after resume from suspend

Hi all, new Arch Linux user (and recent Windows refugee) here. Not sure if this should be posted in Kernel & Hardware instead, but I am posting about a laptop, so here goes nothing.

I've been following the wiki to set up my laptop with hybrid graphics. After following the wiki's section on enabling RTD3 power management (I used the nvidia-prime-rtd3pm AUR package in the end, but I did try manually configuring the udev and module parameters according to the wiki too), everything works file except for one issue: the GPU doesn't re-enter (or stay in?) D3cold after system resume, which is indicated by my laptop's power LED turning orange (along with the standard high power draw on battery).

I found the following workarounds, but there are probably more (such as running a game on the dGPU, but I didn't test this yet):

- Toggle runtime PM off and on again, which worked until I tried to automate this with systemd (see the end of this post).
- Run `lspci` as root (running it as a normal user does nothing - probably because lspci doesn't poll the physical devices, to my understanding).

Just from this brief testing, it seems to me like the GPU driver doesn't properly restore the D3PM state until something interacts with it.

Any suggestions on how I can fix or work around this issue?

Laptop specs

MSI GF63 Thin 11SC
CPU: Intel Core i7-11800H
GPU (integrated): Intel UHD Graphics
GPU (dedicated): NVIDIA GeForce GTX 1650 with Max-Q design

Relevant software

Linux 7.1.4-arch1-1 kernel
mesa 1:26.1.5-1 for (userspace?) Intel GPU drivers
nvidia-open-dkms + nvidia-utils 610.43.03-3 for NVIDIA GPU drivers
KDE Plasma 6.7.3 desktop environment (using Wayland sessions)

Systemd workaround I tried

Based on this Stack Exchange answer.

[Unit]
Description=Fix NVIDIA RTD3 power management after suspend
After=suspend.target

[Service]
ExecStart=/usr/bin/bash /usr/local/sbin/nvidia_rtd3_pm_fix.sh

[Install]
WantedBy=suspend.target

The script pointed to by the above systemd unit has the following contents:

#!/bin/bash
echo on > /sys/bus/pci/devices/0000\:01\:00.0/power/control
echo auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control

Feel free to ask for more information if I missed anything.

Edit: Fixed the `nvidia_rtd3_pm_fix.sh` script not being executed correctly (I forgot to add `/usr/bin/bash` to the `ExecStart` section of the systemd unit, to run the bash script with... well, bash). This didn't fix my problem, though, so leaving it open.

Last edited by Sparronator9999 (Yesterday 04:17:21)

Offline

#2 Yesterday 12:04:12

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,933

Re: NVIDIA GPU not staying/returning to D3cold after resume from suspend

Any suggestions on how I can fix or work around this issue?

https://wiki.archlinux.org/title/PRIME#NVIDIA - tried a udev rule?

Otherwise/alternatively

- Toggle runtime PM off and on again, which worked until I tried to automate this with systemd (see the end of this post).

Make /usr/local/sbin/nvidia_rtd3_pm_fix.sh log its actions, https://man.archlinux.org/man/logger.1 and post the complete system journal for a boot after a wakeup causing this:

sudo journalctl -b | curl -s -H "Accept: application/json, */*" --upload-file - 'https://paste.c-net.org/'

Given "it works manually but not via script" there's a good chance that this is just a race condition and a strategic "ExecStartPre=sleep 3" circumvents that

Offline

Board footer

Powered by FluxBB