Intel 12700H Gforce RTX3070 Ti on Ubuntu 22.04 kernel 5.15.0-40/41-generic and nvidia-driver 515 black screen after suspend

The kernel has issues properly adding the nvidia gpu so the driver can’t load:

[    0.966291] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:01.0/0000:01:00.0/resource0'
[    0.966293] CPU: 2 PID: 208 Comm: irq/122-pciehp Not tainted 5.15.0-41-generic #44-Ubuntu
[    0.966294] Hardware name: LENOVO 82RF/LNVNB161216, BIOS J2CN40WW 04/15/2022
[    0.966295] Call Trace:
[    0.966296]  <TASK>
[    0.966297]  show_stack+0x52/0x58
[    0.966300]  dump_stack_lvl+0x4a/0x5f
[    0.966303]  dump_stack+0x10/0x12
[    0.966304]  sysfs_warn_dup.cold+0x17/0x27
[    0.966306]  sysfs_add_file_mode_ns+0x166/0x170
[    0.966309]  sysfs_create_bin_file+0x64/0x90
[    0.966311]  pci_create_attr+0x147/0x220
[    0.966313]  pci_create_resource_files+0x6f/0x150
[...]
[    1.047463] Fixing recursive fault but reboot is needed!

Please check if upgrading the kernel using the liquorix ppa fixes this.

1 Like

That seems to have fixed it.
Thanks a lot for taking the time ! Really appreciate it.

Okay, the problem is back. I have reinstalled the 515.48.07 driver to see if that might fix it again but no success.
I have installed and signed the liquorix kernel 5.18.0-11.1. I think something is not working when trying to build the nvidia kernel modules. The Error message is saying

DKMS make.log for nvidia-515.48.07 for kernel 5.18.0-11.1-liquorix-amd64 (x86_64)
Mo 18. Jul 18:58:28 CEST 2022
make[1]: Entering directory '/usr/src/linux-headers-5.18.0-11.1-liquorix-amd64'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia/515.48.07/build \
single-build= \
need-builtin=1 need-modorder=1
  ln -sf /var/lib/dkms/nvidia/515.48.07/build/nvidia/nv-kernel.o_binary /var/lib/dkms/nvidia/515.48.07/build/nvidia/nv-kernel.o
  ln -sf /var/lib/dkms/nvidia/515.48.07/build/nvidia-modeset/nv-modeset-kernel.o_binary /var/lib/dkms/nvidia/515.48.07/build/nvidia-modeset/nv-modeset-kernel.o
 CONFTEST: hash__remap_4k_pfn
[...]

here comes the bug-report
nvidia-bug-report.log (1.8 MB)

The error message is “normal”, always displayed. Just ignore. According to the log, gpus are working.

For 510+ drivers, do we need a kernel upper than 5.16? @generix

The minimum kernel for that is 3.10.

The suspend → black screen (no backlight) issue persists after installing the latest XXXXX.run Driver from the nvidia website using sudo sh XXXXX.run with -s option and private and public pair.
I can change the screen-brightness just fine on i3. But as soon as is close the lid or initiate suspend by systemctl there is no display, the keyboard backlight and fan go back up but thats about it. Only thing that helps is hard power off /on.
I will attach the most recent dmesg and bug report.
nvidia-bug-report.log (1.3 MB)

dmesg.out (92.8 KB)

You should rather not use the runfile installer on a hybrid graphics notebook.
You have set PreserveVideoMemoryAllocations: 0, please disable
nvidia-suspend.service
nvidia-resume.service
nvidia-hybernate.service
systemd units and check if that resolves it.

it does not. should i also try setting PreserveVideoMemoryAllocations: 1 and enable the systemd units ?
Otherwise i would probably try to get a clean install using the “Software & Updates” application native to ubuntu without any grub and dkms modifications again and go from there.

Can you ssh into the system after resume?

It did work at some point in the past! I can try again tomorrow, what information do you need from there ?

a dmesg output.

dmesg.out (105.6 KB)

Seems like a kernel i915 driver problem ?

Yes. Since you already run the latest bios and kernel, you can only open an issue with the i915 driver
https://gitlab.freedesktop.org/drm/intel

You are not alone, known problem: dell - Ubuntu 20.04 doesn't wake up after suspend - Ask Ubuntu
Not sure whos issue, but, the word is out.

short update:
I spoke with the intel i915 guys and the problem seems to be with the VBT of the BIOS. There is a internal Lenovo ticket now for Thinkpad T14G3 but not sure if it will be implemented for other devices.
Here is the discussion, for anybody thats interested:

It seems I have the the same problem… we also bought a Legion 5 16IAH7H and want to run ubuntu on it. I finally installed Ubuntu 22.10, kernel 5.19… Now it seems there is a Bios update available on Lenovo. Have you installed it yet? I don’t know how to install the *.EXE file in ubuntu correctly. We tried it through wine, but the whole thing won’t go through…

I installed the BIOS update through Windows as I am in a dual-boot setup. But its not changing the behavior.

I have the AMD L5 Pro (5800h + 3070). I recently did BIOS update, and I kept a small Windows install on the SSD just for BIOS updates, as Lenovo doesn’t provide tools to do it from e.g. bootable media. The Windows tool I believe puts the new image somewhere on the EFI partition and configures it to boot into a BIOS updater on next reboot. You can run the EXE to just unpack the BIOS installer, but there is no obvious way to do anything other than run it on Windows.

With that said, the BIOS update bricked my EFI partition. GRUB stopped working, etc. It’s possible re-adding it to the EFI boot menu would have worked, but by the time I figured out what had happened I was partway through re-installing GRUB and re-generating the initramfs. So…my advice…keep a rescue boot device handy to recover EFI after a BIOS update…