Fedora 39, Kernel 6.7.4, Nvidia gpu, screen not waking up

Hello,

Sorry if this is a rookie question i am kind of new to linux, tried to do some research but to no avail.
I am running i3, fedora 39 with proprietary nvidia drivers, laptop is in hybrid mode, day to day i am running the integrated gpu, only running gpu intensive apps on the discrete gpu.

NVreg_PreserveVideoMemoryAllocations=1 is set.

Suspend, resume and hibernate nvidia services are enabled.

Suspend work flawlessly while plugged in, but if i am on battery then the screen doesn’t wake up(black screen), if then i close the lid, plug in the cable and open the lid after some time, i do get an image but the screen is frozen.

I am running i3 on fedora 39, kernel 6.7.4 and nvidia driver version 545.29

Hardware:

  • cpu: Amd 5800H
  • gpu: Nvidia 3050TI

If anyone can show me how to debug this i would be grateful.
Thanks.

I had the same problem, I just assumed it was a Lenovo problem with my desktop, though no problems with my Lenovo laptops. Nvidia seems a more likely culprit as you say. I “solved” it by changing my settings so that the PC wouldn’t hibernate, though the screen will still turn off. Not much of a solution I know but in the meantime it’ll keep your system from crashing. Hopefully someone else will post a fix here

Understood, i do have a lenovo laptop though it’s the from the legion series, of course if i had an amd gpu this would’ve been much a smoother experience. Thank you for the proposition.

We need more information. Please mention how you installed nvidia drivers (from rpmfusion or download from Nvidia, etc.). We also need hardware details which you can get by running inxi -Fzxx in a terminal (as searchable text, using the </> button, so others with the same hardware can find this thread). The inxi output will tell us what graphics hardware you have and the Nvidia driver version.

Nvidia drivers were installed from rpmfusion and here’s the result from the inxi command:

System:
  Kernel: 6.7.4-200.fc39.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.40-14.fc39
  Desktop: i3 v: 4.23 dm: LightDM Distro: Fedora Linux 39 (Thirty Nine)
Machine:
  Type: Laptop System: LENOVO product: 82JS v: Legion 5 Pro 16ACH6
    serial: <superuser required> Chassis: type: 10 v: Legion 5 Pro 16ACH6
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: NO DPK serial: <superuser required>
    part-nu: LENOVO_MT_82JS_BU_idea_FM_Legion 5 Pro 16ACH6 UEFI: LENOVO
    v: HHCN24WW date: 11/24/2021
Battery:
  ID-1: BAT0 charge: 40.7 Wh (56.0%) condition: 72.7/80.0 Wh (90.9%)
    volts: 15.5 min: 15.4 model: Sunwoda L20D4PC1 serial: <filter>
    status: not charging
CPU:
  Info: 8-core model: AMD Ryzen 7 5800H with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 3 rev: 0 cache: L1: 512 KiB L2: 4 MiB L3: 16 MiB
  Speed (MHz): avg: 926 high: 2921 min/max: 400/4463 cores: 1: 400 2: 2921
    3: 2623 4: 400 5: 400 6: 400 7: 400 8: 400 9: 1915 10: 400 11: 400 12: 400
    13: 1459 14: 400 15: 1507 16: 400 bogomips: 102206
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: NVIDIA GA107BM [GeForce RTX 3050 Ti Mobile] vendor: Lenovo
    driver: nvidia v: 545.29.06 arch: Ampere pcie: speed: 8 GT/s lanes: 8 ports:
    active: none empty: DP-1, DP-2, HDMI-A-1, eDP-2 bus-ID: 01:00.0
    chip-ID: 10de:25e0
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    vendor: Lenovo driver: amdgpu v: kernel arch: GCN-5 pcie: speed: 8 GT/s
    lanes: 16 ports: active: eDP-1 empty: none bus-ID: 06:00.0
    chip-ID: 1002:1638 temp: 36.0 C
  Display: x11 server: X.Org v: 1.20.14 compositor: Picom v: 11 driver: X:
    loaded: amdgpu,nvidia unloaded: fbdev,modesetting,nouveau,vesa alternate: nv
    dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1600 s-dpi: 96
  Monitor-1: eDP-1 mapped: eDP model-id: CSO 0x1609 res: 2560x1600 dpi: 188
    diag: 407mm (16")
  API: OpenGL v: 4.6 vendor: amd mesa v: 23.3.5 glx-v: 1.4 es-v: 3.2
    direct-render: yes renderer: AMD Radeon Graphics (radeonsi renoir LLVM
    17.0.6 DRM 3.57 6.7.4-200.fc39.x86_64) device-ID: 1002:1638
Audio:
  Device-1: NVIDIA driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s
    lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:2291
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo driver: N/A
    pcie: speed: 8 GT/s lanes: 16 bus-ID: 06:00.5 chip-ID: 1022:15e2
  Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
    v: kernel pcie: speed: 8 GT/s lanes: 16 bus-ID: 06:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.7.4-200.fc39.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.0.3 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: 2000 bus-ID: 03:00.0 chip-ID: 10ec:8168
  IF: eno1 state: down mac: <filter>
  Device-2: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: Lenovo driver: mt7921e v: kernel pcie: speed: 5 GT/s lanes: 1
    bus-ID: 04:00.0 chip-ID: 14c3:7961
  IF: wlp4s0 state: up mac: <filter>
Bluetooth:
  Device-1: Foxconn / Hon Hai MediaTek Bluetooth Adapter driver: btusb v: 0.8
    type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 bus-ID: 3-4:4 chip-ID: 0489:e0cd
  Report: btmgmt ID: hci0 rfk-id: 12 state: up address: <filter> bt-v: 5.2
    lmp-v: 11
Drives:
  Local Storage: total: 942.7 GiB used: 11.16 GiB (1.2%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 500GB
    size: 465.76 GiB speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 27.9 C
  ID-2: /dev/nvme1n1 vendor: SK Hynix model: HFS512GDE9X084N
    size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 33.9 C
Partition:
  ID-1: / size: 464.17 GiB used: 10.75 GiB (2.3%) fs: btrfs
    dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 395.6 MiB (40.6%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 19 MiB (3.2%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 464.17 GiB used: 10.75 GiB (2.3%) fs: btrfs
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 63.0 C mobo: 34.0 C gpu: amdgpu temp: 38.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB note: est. available: 13.5 GiB used: 6.17 GiB (45.7%)
  Processes: 539 Power: uptime: 1d 5h 0m wakeups: 9 Init: systemd v: 254
    target: graphical (5) default: graphical
  Packages: pm: snap pkgs: 13 Compilers: clang: 17.0.6 gcc: 13.2.1
    Shell: Zsh v: 5.9 running-in: alacritty inxi: 3.3.32

This is the second issue I see with Sleep/Suspend and kernel 6.7.4, Can you try to go to kernel.6.6.14 ? or another kernel you have older than 6.7.4 ? Just boot into the system with the older kernel if you have it.

just tried 6.5.6 and 6.6.13 issue still persisting, 6.5.6 failed to find nvidia kernel module and started with nouveau and still the same issue

This does shift attention away from Nvidia. Note that the Nvidia kernel module has to built for each kernel, but this should be handled automatically with updates.

amdgpu bug reports should go to FreeDesktop.org drm/amd. You could try running their S0i3/s2idle analysis script for AMD systems (amd_s2idle.py).

Here is the result of the script:

Location of log file (default s2idle_report-2024-02-19.txt)? 👀 ACPI extraction tool `iasl` is missing. Attempting to install.
Debugging script for s2idle on AMD systems
💻 LENOVO 82JS (Legion 5 Pro 16ACH6) running BIOS 1.24 (HHCN24WW) released 11/24/2021 and EC 1.24
🐧 Fedora Linux 39 (Thirty Nine)
🐧 Kernel 6.7.4-200.fc39.x86_64
🔋 Battery BAT0 (Sunwoda L20D4PC1) is operating at 90.85% of design
Checking prerequisites for s2idle
✅ Logs are provided via systemd
✅ AMD Ryzen 7 5800H with Radeon Graphics (family 19 model 50)
✅ LPS0 _DSM enabled
❌ ACPI FADT doesn't support Low-power S0 idle
✅ HSMP driver `amd_hsmp` not detected (blocked: False)
❌ PMC driver `amd_pmc` did not bind to any ACPI device
✅ GPU driver `amdgpu` available
❌ System isn't configured for s2idle in firmware setup
✅ NVME SK hynix Gold P31/BC711/PC711 NVMe Solid State Drive is configured for s2idle in BIOS
✅ NVME Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO (SSD 980 PRO) is configured for s2idle in BIOS
✅ GPIO driver `pinctrl_amd` available
ACPI extraction tool `iasl` is missing
❌ Kernel is tainted: 12289
Your system does not meet s2idle prerequisites!
Explanations for your system
🚦 The kernel didn't emit a message that low power idle was supported
	Low power idle is a bit documented in the FADT to indicate that
	low power idle is supported.
	Only newer kernels support emitting this message, so if you run on
	an older kernel you may get a false negative.
	When launched as root this script will try to directly introspect the
	ACPI tables to confirm this.
🚦 AMD-PMC driver is missing
	The amd-pmc driver is required for the kernel to instruct the
	soc to enter the hardware sleep state.
	Be sure that you have enabled CONFIG_AMD_PMC in your kernel.

	If CONFIG_AMD_PMC is enabled but the amd-pmc driver isn't loading
	then you may have found a bug and should report it.
🚦 The system hasn't been configured for Modern Standby in BIOS setup
	AMD systems must be configured for Modern Standby in BIOS setup
	for s2idle to function properly in Linux.
	On some OEM systems this is referred to as 'Windows' sleep mode.
	If the BIOS is configured for S3 and you manually select s2idle
	in /sys/power/mem_sleep, the system will not enter the deepest hardware state.
🚦 Kernel is tainted
	A tainted kernel may exhibit unpredictable bugs that are difficult for this script to characterize.
	If this is intended behavior run the tool with --force.

For more information on this failure see:
	https://gitlab.freedesktop.org/drm/amd/-/issues/3089
AMD-PMC driver is missing
	The amd-pmc driver is required for the kernel to instruct the
	soc to enter the hardware sleep state.
	Be sure that you have enabled CONFIG_AMD_PMC in your kernel.

	If CONFIG_AMD_PMC is enabled but the amd-pmc driver isn't loading
	then you may have found a bug and should report it.
🚦 The system hasn't been configured for Modern Standby in BIOS setup
	AMD systems must be configured for Modern Standby in BIOS setup
	for s2idle to function properly in Linux.

AMD_PMC is enabled as a module:

% cat /boot/config-$(uname -r) | grep -i CONFIG_AMD_PMC
CONFIG_AMD_PMC=m

Next steps:

Look for error messages with `Journalctl -b -g amd_pmc`[edit replace `-` with `_`].  Check for "Modern Standby" in your BIOS settings.

ran:

cat /boot/config-$(uname -r) | grep -i CONFIG_AMD_PMC
CONFIG_AMD_PMC=m

saw that CONFIG_AMD_PMC=m is there, changed it to CONFIG_AMD_PMC=y(just in case, didn’t know what =m meant) rebooted and ran (both before and after i changed “=m” into “=y”, same result)

journalctl -b -g amd-pmc

has no entries, running the amd script again still shows that amd pmc is missing. Bios has no option related to sleep or standby

CONFIG_AMD_PMC-m is telling the kernel to load amd_pmc as a module. Changing that may have negative effects.

Is the kmod-nvidia package installed for the 6.5.6 kernel? dnf list kmod-nvidia should show that. If not it really is not an issue until you boot with that kernel.

Since fedora 39 is far beyond the 6.5.X kernels I would not worry about that issue but rather focus on getting the system working with the newer (6.7.X) kernels.

Make sure you have the latest BIOS update.

[quote=“Angel S, post:11, topic:105545, username:ankus”]ypo: it should be amd_pmc.

journalctl -b -g amd-pmc

[/quote]
Typo: it should be amd_pmc (docs often use dashes, filenames switch to _).

The CONFIG_AMD_PMC=m setting is used when building the kernel. Editing /boot/config-$(uname -r) can only confuse software that checks for the m.

Returned the option to “=m”, also ran the journalctl with “amd_pmc”, still no entries, i should be running the latest bios version but will double check

In a terminal you can try loading the module to see if it prints an error message:

% sudo modprobe -v amd_pmc

loaded the module successfully, ran journalctl on the module, no errors.
Disconnected the power and closed the lid, everything works as expected.
How can i load the module automatically without running it manually myself, should i create a service that does this ?

edit: scratch that, issue still persists, running the amd script still get the message that the AMD_PMC driver is missing

edit 2:
running (lsmod | grep amd) is see that the amd_pmc is loaded but the script still says that the amd pmc is missing

We need to understand why you couldn’t reproduce the test where you manually loaded the “amd_pmc” module. For that, you can use journalctl to compare a messages from the boot where manually loading the module allowed you to close the lid and then get the screen to wake up (assuming that is meant by “works as expected”). I assume “the script” refers to amd_s2idle.py, but the output you provided has: PMC driver amd_pmc did not bind to any ACPI device. It also says ACPI extraction tool iasl is missing.
You should install the package that provides iasl. To get the name of the package:

% doas dnf whatprovides '*/iasl'
Last metadata expiration check: 1:39:28 ago on Tue Feb 20 17:29:21 2024.
acpica-tools-20220331-6.fc39.x86_64 : ACPICA tools for the development and debug of ACPI tables
Repo        : fedora
Matched from:
Filename    : /usr/bin/iasl

For background, see: ACPI Tricks and Tips. Don’t worry about running iasl yourself, it is needed by amd_s2idle.py and may help pin down the reason amd_pmc isn’t working reliably.

Thank you for sharing the background for ACPI. Already installed the ‘acpica-tools’ still the result is the same. For the ‘correct’ scenario when closing the lid and then the laptop waking up, it only occurred once, the first time i loaded manually the amd_pmc. After that i am back to the old behavior in which i get a black screen after waking up. So i am unable to reproduce the ‘correct’ behavior. I did get a new scenario in which after loading the ‘amd_pmc’ after opening the lid and maybe 20 seconds later the screen would show picture but everything was frozen then it goes into a series of blinking(showing the screen, then black, then showing the screen again).

cat /sys/power/mem_sleep

returns

s2idle [deep]

The acpica-tools should allow the python script to provide additional detail (that may only be useful to an ACPI expert!).

Is the final “showing the screen again” the frozen content or does it work normally?
If the latter, the problem appears to be the missing BIOS support preventing the module from loading without manual intervention.