NVIDIA GPU and i915 kernel module

I have a desktop PC with an NVIDIA GPU. Recently, whenever I switched to the console and whenever logging out of a KDE session, the screen would remain black. Interestingly everything works fine with linux kernel <= 5.15.55 - the problem appears exactly with kernel version 5.15.56.

The problem goes away if I blacklist the i915 kernel module. Blacklisting it with boot.blacklistedKernelModules did not work, I had to add module_blacklist=i915 as a kernel parameter.

Anyway, all of that took me forever to figure out. I wonder why i915 is loaded at all on a desktop system with an NVIDIA GPU. And is there a way of documenting this, so that others don’t run into the same issues?

I assume you have an intel processor with an integrated gpu? If so, the kernel is set up to autodetect available hardware and load modules for it. The presence of an Nvidia GPU doesn’t mean that your intel GPU suddenly isn’t there, you might want to use it after all.

I’d wager this is because of early modesetting, which will load your graphics driver during init and carry it over. This results in faster boots and better boot-time graphics with less flickering.

I imagine your other problems stem from this causing your system to schedule things onto different GPUs somewhat haphazardly - you likely want to enable hardware.nvidia.modesetting.enable, but that will probably break your system in unexpected ways if it’s not set up correctly.

Rather than just disabling the intel graphics on the kernel command line, maybe look at the wiki entry for optimus mode: Nvidia - NixOS Wiki

Or if you truly want to disable intel graphics, find the switch in your BIOS.

Thanks @TLATER, for these explanations. I had earlier tried enabling Nvidia modesetting (which didn’t work), and, surprisingly, my Dell BIOS has no switch for disabling the Intel graphics unit.

I always thought Optimus mode is only for laptops so I hadn’t tried it, and now I’m happy with the current setup of blacklisting i915.

I guess you have answered my main question. I’m still curious if this should be documented somewhere - I didn’t think my hardware configuration is uncommon. Or maybe it would make sense if NixOS had a configuration option that ensures only the discrete GPU is activated.

Yeah, the wiki entry could be clearer. It’s basically for all iGPU+dGPU setups, which are usually laptops. Most desktop PCs don’t have this mix IME, or at least not the ones that people end up running Linux on.

That said, I think a note about your hack to blacklist the intel driver (and ideally the AMD driver too) in Nvidia - NixOS Wiki might be sufficient.

Just with a clear caveat that this won’t work on most laptops and will completely disable the iGPU - and that this isn’t always desirable, since the iGPU often has a more generous variety of codecs available, and especially with intel + nvidia on Linux it can provide video acceleration much more easily.

I added this fix to the troubleshooting section of the Nvidia Wiki. I decided to only say that this disables the integrated GPU, and not add a lengthy discussion about possible disadvantages. This is because it’s in the troubleshooting section for specific symptoms, so I assume readers will only try to apply this if they encounter the “black screen” problem. A discussion about advantages and disadvantages of using the integrated GPU does not seem to be a good fit, and should appear elsewhere. There is also a link to the discussion here. Feel free to make changes, though.

1 Like

Regarding AMD, I cannot say much. I have not had any problems on my desktop with AMD GPU, even though the Intel CPU also has an integrated GPU. As far as I can tell, AMD drivers have much fewer problems in Linux.

Yep, but an AMD CPU with an integrated GPU in a system with an Nvidia GPU will probably need to have a blacklisted kernel module, too.

1 Like

Got it - you were talking about an AMD CPU, not GPU.