No HDMI in Nvidia on-demand mode since kernel 6.4.x

Hi :)

Since Kernel 6.4.x there is a critical bug for Lenovo Legion Models at all distros. If the dynamic mode in the bios is selected, Linux always only detected the iGPU. If you switch to only NVIDIA mode, everything is working. I tested it with different kernels, distros and Nvidia drivers, always the same issue. Only with kernel 6.3.x and below it is working perfect. There are a lot of reports over different distros and setups, and all of them using Lenovo legion models.

reports:

https://bbs.archlinux.org/viewtopic.php?id=289325

errors in logs:
[drm:nv_drm_load [nvidia_drm]] ERROR [nvidia-drm] [GPU ID 0x00000100] Failed to allocate NvKmsKapiDevice
[drm:nv_drm_probe_devices [nvidia_drm]] ERROR [nvidia-drm] [GPU ID 0x00000100] Failed to register device

Legion laptop with Nvidia.

  • Nouveau : no hdmi
  • Nvidia 535/345 dynamic graphics : no HDMI (screen not detected) / no nvidia gpu is shown up
  • Nvidia 535/345 discrete graphics : HDMI is detected / nvidia gpu is shown up

So I suppose this bug to be linked to Intel GPU or Nvidia? Maybe a kernel Bug?


ProblemType: Bug
ApportVersion: 2.27.0-0ubuntu2
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/controlC0: fthx 3395 F… wireplumber
/dev/snd/controlC1: fthx 3395 F… wireplumber
/dev/snd/seq: fthx 3390 F… pipewire
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 23.10
InstallationDate: Installed on 2021-09-15 (723 days ago)
InstallationMedia: Ubuntu 21.10 “Impish Indri” - Alpha amd64 (20210910)
MachineType: {report[‘dmi.sys.vendor’]} {report[‘dmi.product.name’]}
NonfreeKernelModules: nvidia_modeset nvidia
Package: linux (not installed)
ProcEnviron:
LANG=fr_FR.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-256color
XDG_RUNTIME_DIR=
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-6.5.0-5-generic root=/dev/mapper/vgubuntu-root ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 6.5.0-5.5-generic 6.5.0
RelatedPackageVersions:
linux-restricted-modules-6.5.0-5-generic N/A
linux-backports-modules-6.5.0-5-generic N/A
linux-firmware 20230815.git0e048b06-0ubuntu1
Tags: mantic wayland-session
Uname: Linux 6.5.0-5-generic x86_64
UpgradeStatus: Upgraded to mantic on 2023-03-06 (186 days ago)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo vboxusers
_MarkForUpload: True
dmi.bios.date: 07/10/2023
dmi.bios.release: 1.54
dmi.bios.vendor: LENOVO
dmi.bios.version: J2CN54WW
dmi.board.asset.tag: NO Asset Tag
dmi.board.name: LNVNB161216
dmi.board.vendor: LENOVO
dmi.board.version: SDK0T76461 WIN
dmi.chassis.asset.tag: NO Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Legion 5 Pro 16IAH7H
dmi.ec.firmware.release: 1.54
dmi.modalias: dmi:bvnLENOVO:bvrJ2CN54WW:bd07/10/2023:br1.54:efr1.54:svnLENOVO:pn82RF:pvrLegion5Pro16IAH7H:rvnLENOVO:rnLNVNB161216:rvrSDK0T76461WIN:cvnLENOVO:ct10:cvrLegion5Pro16IAH7H:skuLENOVO_MT_82RF_BU_idea_FM_Legion5Pro16IAH7H:
dmi.product.family: Legion 5 Pro 16IAH7H
dmi.product.name: 82RF
dmi.product.sku: LENOVO_MT_82RF_BU_idea_FM_Legion 5 Pro 16IAH7H
dmi.product.version: Legion 5 Pro 16IAH7H
dmi.sys.vendor: LENOVO

Please uninstall bbswitch and create a nvidia-bug-report.log after reboot.

nvidia-bug-report.log.gz (418.3 KB)

Here also a bug report from a working setup with a kernel below 6.4.x:
nvidia-bug-report.log.gz (448.1 KB)

If possible, please create a new nvidia-bug-report.log with kernel 6.3 right after boot. Your wifi’s driver is regularly crashing so dmesg was flooded with iwlwifi messages.

nvidia-bug-report.log.gz (392.6 KB)

The error is always NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x24:0x72:1436) which means something like the driver couldn’t get access to the gpu’s frame buffer or else.
Also the intel i915 driver seems to have an issue with that, with 6.3 it took 10 seconds to initialize the frame buffer, with 6.4 it needs even 20 seconds.
6.3:

[    4.404397] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[   14.103491] BTRFS: device fsid d1b0a882-4a74-4c55-86f3-83c948b07448 devid 1 transid 5956 /dev/dm-0 scanned by (udev-worker) (1083)

6.4:

[    4.257306] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[   25.404279] BTRFS: device fsid d1b0a882-4a74-4c55-86f3-83c948b07448 devid 1 transid 5270 /dev/dm-0 scanned by (udev-worker) (1517)

So I think there’s a general kernel issue with your notebook model which got worse from 6.3 to 6.4, your boot taking ages. Maybe also open a bug report with the i915 driver to get some more insight.