Nvidia T550 optimus breaks s3 and s4

Hello folks,

I have recently got a ThinkPad P14s which comes with a beefy i7-1260p, Intel integrated gpu, and a nvidia T550 as discrete card.

Since I installed the x11-drivers/nvidia-drivers the laptop won’t sleep nor hibernate anymore. I googled around and it seems to be a common issue with optimus hybrid laptops, though none of the solutions I came across did work for me, and unfortunately the nvidia gpu cannot be turned off from the BIOS.
Uninstalling the nvidia driver will cause the fan to spin out of control and be stuck at maximum speed all the time.

Some context:

Distro: Gentoo
kernel: 6.1.19
Also tried driver version 525.105.17 and 530.41.03, none of which have solved the issue.


# NVIDIA drivers options
# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.

# nvidia-drivers and nouveau cannot be used at same time.
# Comment out the following line if you wish to allow nouveau.
blacklist nouveau

# Kernel Mode Setting (notably needed for EGLStream/Wayland)
# Enabling may possibly cause issues with SLI and Reverse PRIME.
options nvidia-drm modeset=1

# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend),
# but even then may lead to issues on some setups (keep 0 if in doubt).
options nvidia \
        NVreg_PreserveVideoMemoryAllocations=0 \
        NVreg_TemporaryFilePath=/var/tmp \

# !!! Security Warning !!!
# Do not change the DeviceFile options unless you know what you are doing.
# Only add trusted users to the 'video' group, these users may be able to
# crash, compromise, or irreparably damage the machine.
options nvidia \
        NVreg_DeviceFileGID=27 \
        NVreg_DeviceFileMode=432 \
        NVreg_DeviceFileUID=0 \

# Should be no need to touch anything below.
alias char-major-195 nvidia
alias /dev/nvidiactl char-major-195
remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia


# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"

# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"


nvidia_drm             61440  2
nvidia_modeset       1200128  2 nvidia_drm
nvidia              55738368  72 nvidia_modeset
video                  57344  3 thinkpad_acpi,i915,nvidia_modeset

make.conf (Gentoo specific, relative variable to issue is VIDEO_CARDS)

COMMON_FLAGS="-march=alderlake -O2 -pipe"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3"
USE="-doc -handbook -systemd -gnome -gtk-doc nvidia kde plasma qt5 smp vaapi syslog wayland elogind dbus upower pulseaudio ffmpeg udisks dbus png lz4 zstd git"
VIDEO_CARDS="intel iris nvidia"
# NOTE: This stage was built with the bindist Use flag enabled
# Also saves successful build logs

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.

LINGUAS="en uk"

QEMU_SOFTMMU_TARGETS="x86_64 aarch64"
QEMU_USER_TARGETS="x86_64 aarch64"

# Filter LLVM's targets to x86 only

# Fuck systemd unconditional deps

I tried flipping NVreg_PreserveVideoMemoryAllocations from 0 to 1 but made no difference, just as NVreg_DynamicPowerManagement=0x03 made any difference either.

Any idea as to how I can get the laptop to sleep and hibernate again? I am fine with turning off the nvidia gpu completely if that is an option and can solve the problem.


Any idea? :(