90-nvidia.conf incompatible with HDMI external monitor

Upon connecting external HDMI monitor Xsession drops and I get logged out. Problem is resolved if I delete the auto-generated 90-nvidia.conf but in this case GPU doesn’t work even though it appears loaded on prime-select.
nvidia-bug-report.log.gz (930.9 KB)

-----------------------90-nvidia.conf ------------------------------
Section “ServerLayout”
Identifier “layout”
Screen “nvidia”
Inactive “intel”
Inactive “modesetting”
EndSection

Section “Screen”
Identifier “intel”
Device “intel”
EndSection

Section “Device”
Identifier “intel”
Driver “intel”
EndSection

Section “Screen”
Identifier “modesetting”
Device “modesetting”
EndSection

Section “Device”
Identifier “modesetting”
Driver “modesetting”
EndSection

Section “Screen”
Identifier “nvidia”
Device “nvidia”
EndSection

Section “Device”
Identifier “nvidia”
Driver “nvidia”
BusID “PCI:1:0:0”
Option “DPI” “96 x 96”
Option “AllowEmptyInitialConfiguration”
Option “AllowExternalGpus”
EndSection

That config is broken, don’t use it.
Which distro are you using, the logs don’t tell? What are you trying to achieve?
Per default, the nvidia gpu is in offload mode
https://forums.developer.nvidia.com/t/ubuntu-20-04-does-not-use-nvidia-gpu/243803/2?u=generix

thanks for the info. I’m running Opensuse Leap 15.4 (kernel 5.14.21-150400.22-default) with KDE Plasma. Unfortunately some of the info in the referred thread was inapplicable.
I’m trying to get the GPU to work without forcibly logging me off upon connection with an external monitor. I’ll be happy to provide other info.

Please create a new nvidia-bug-report.log with the config deleted and the hdmi monitor connected.

Please see attached the bug reports before (pre) and after (post) the external monitor is connected. Both were obtained after I deleted the 90-nvidia.conf and rebooted. As mentioned earlier:

The nvidia modules are loading too late, please embed them into the initrd.

thanks but unfortunately I couldn’t find how/where this should be done. I’m attaching /etc/X11/xinit/xinitrc and /etc/X11/xinit/xinitrc.common where I suspect this should be done and would appreciate any additional guidance. Thanks
xinitrc (1.1 KB)
xinitrc.common (5.1 KB)

Like this:
https://forums.developer.nvidia.com/t/cant-run-any-program-via-nvidia-card/169074/4

thank you but unfortunately it didn’t seem to have made a difference. If I delete 90-nvidia.conf, upon reboot the GPU does not load (despite what prime-select says) and it goes into the Intel. I attach the updated /etc/dracut.conf.d/60-nvidia-default.conf and bug-report.
60-nvidia-default.conf (125 Bytes)
nvidia-bug-report.log.gz (893.6 KB)

Did you run sudo dracut -f afterwards?

yes. If u need the output, let me know. Thanks

Really don’t know why the modules still load late. You might create an additional config in /etc/modules-load.d/ to force driver loading and run dracut -f afterwards
http://www.polarhome.com/service/man/?qf=modules-load.d&tf=2&of=OpenSuSE&sf=5

thank you for the suggestion. Unfortunately the problem persists and seems to be closely tied to the 90-nvidia.conf file, i.e. something important points to it and unless it’s in place the load collapses. I would try a complete unistall/re-install. Is there anything I’d be particularly mindful of?

IDK, from the log perspective, this looks like the driver doesn’get embedded into the initrd.