Questions about the nouveau driver and the nouveau.modeset=0 boot option

Hi,
i am wondering how the nouveau driver works or how it gets used when installed.

I have a Dell XPS laptop with a NVIDIA 1050 gtx mobile graphic card next to a Intel HD 630 chip. Because of the known problems with hybrid graphic pcs and because i mostly use the laptop for work and want a maximized battery time, i never installed the proprietary NVIDIA driver.
As i first installed opensuse Tumbleweed on the laptop half a year ago the nouveau driver was not working and i had to add the nouveau.modeset = 0 line to the grub kernel boot parameters to get the installer working. Even after the installation i had to keep the line, because without it the system always hung up during boot. But i never blocked the installation and update of nouveau packages and so every so and then new versions get installed when running zypper dup.

But i noticed something interesting, i always thought that nouveau.modeset = 0 means that the nouveau driver module is not loaded and such the driver is not used. But when running:

lspci -k | grep -EA2 'VGA|3D'

i get this output:

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
    DeviceName:  Onboard IGD
    Subsystem: Dell Device 07be
--
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
    Subsystem: Dell Device 07be
    Kernel modules: nouveau


for me that looks like as it the nouveau driver is used for the nivida card. What is actually happening here?

The next thing i noticed was that after removing the modeset = 0 line for testing a few days ago my system was able to boot fine! So it seems that some updates of the driver in the past added support for my card, at least some kind of. I cannot really notice any difference in the performance of the the system, the only difference is that the system always hangs during shutdown when having the module activated. So i guess it is better to give it some time before trying it again.

But it is interesting that the output of

lspci -k | grep -EA2 'VGA|3D'

is exactly the same as if the modeset line was not removed.
So can someone explain to me how the nouveau driver works?

Or to give you some structure, here are my questions in a ordered form:

  1. is it correct to assume, that using the nouveau.modeset = 0 boot parameter, disables the nouveau kernel module and such prevent the use of the nouveau driver for the nvidia card?
  2. If yes, does removing the line results in the system automatically using the nouveau driver for the card and such using the card in any way?
  3. Why are the lspci outputs the same no matter if i use the parameter or not?

First point – it’s a driver stack. Simplistically, there is the kernel driver (nouveau … specifically, nouveau.ko), the xorg ddx driver (nouveau … specifically, nouveau.drv) and the 3d/opengl driver from Mesa (there are several related to nouveau, but each is specific to particular nvidia devices e.g. 970, 1050 gtx etc …)

The updates you see are for the userspace xorg or mesa components. The kernel driver comes bundled in any kernel update.

But i noticed something interesting, i always thought that nouveau.modeset = 0 means that the nouveau driver module is not loaded and such the driver is not used.
correct

But when running:

lspci -k | grep -EA2 'VGA|3D'

i get this output:

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
    DeviceName:  Onboard IGD
    Subsystem: Dell Device 07be
--
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
    Subsystem: Dell Device 07be
    Kernel modules: nouveau

for me that looks like as it the nouveau driver is used for the nivida card. What is actually happening here?
you’re running the command lspci and then (from the entirety of that command’s output) piping it via the grep command to print only lines relevant to your search parameter, and, further, to then print a couple of extra subsequent lines from the lspci output that follow your search term hit

if you expanded your additional lines of output you’d have seen “kernel driver in use:” reported for the intel adapter. You don’t see it for the nouveau because no kernel driver is being used. You do receive a list of possible kernel modules to use (“kernel modules: …”) with the device though. Try using -A3 and -A4 … you will see consecutively more lines of info

A perhaps more useful and succinct command to run is:

inxi -GSxx 

(though you’ll have to install inxi first)

The next thing i noticed was that after removing the modeset = 0 line for testing a few days ago my system was able to boot fine! So it seems that some updates of the driver in the past added support for my card, at least some kind of. I cannot really notice any difference in the performance of the the system, the only difference is that the system always hangs during shutdown when having the module activated. So i guess it is better to give it some time before trying it again.

But it is interesting that the output of

lspci -k | grep -EA2 'VGA|3D'

is exactly the same as if the modeset line was not removed.
I suspect you’ll see a difference when you take into account what I wrote above.

So can someone explain to me how the nouveau driver works?

Or to give you some structure, here are my questions in a ordered form:

  1. is it correct to assume, that using the nouveau.modeset = 0 boot parameter, disables the nouveau kernel module and such prevent the use of the nouveau driver for the nvidia card?
    correct
  1. If yes, does removing the line results in the system automatically using the nouveau driver for the card and such using the card in any way?
    the kernel driver for the device will be loaded. Your intel adapter will still be the primary device though.
  1. Why are the lspci outputs the same no matter if i use the parameter or not?
    see above

Thank you that was very helpful and cleared some things up.
I have read that the nouveau driver is, in contrast to the proprietary driver, able to allow real runtime switching between the intel and the nvidia device. That is why am interested in testing the nouveau driver currently. You said that the intel driver will stay the primary device even after loading the nouveau kernel module. Can you give me some directions on where to find information about activating/testing the nouveau driver and its hybrid capabilities?

Yes, the nouveau kernel driver has runtime dynamic power. See:

sudo cat /sys/kernel/debug/vgaswitcheroo/switch

In addition to that capability, it should have some sort of power management scheme for handling the device while it’s operating. I haven’t a clue what the latest PM capabilities are and aren’t for the nouveau driver’s handling of the various nvidia hardware.

As for the nvidia prop. driver stack, I have no idea what they do and don’t support … but it sounds a little suspect to me that they wouldn’t have some sort of level of functionality

You said that the intel driver will stay the primary device even after loading the nouveau kernel module. Can you give me some directions on where to find information about activating/testing the nouveau driver and its hybrid capabilities?
Use “DRI_PRIME” to set who is driving the bus.

For example (and it’s a poor one, but I use it to strictly convey the point), try:

DRI_PRIME=0 inxi -SGxx

and then subsequently run

DRI_PRIME=1 inxi -SGxx

Now, of course, you’re not gonna want or need to set a power hungry adapter to task on the demanding requirements of a terminal utility. But if you’re looking to play the latest “Escape from Martian Death Camps” or whatever game, then have at it.

Appendium to earlier post: One point that I forgot to include and mention about nomodeset is in regards to kernel driver being in the initrd … that has to be accounted for too.

Is it enough to have the nouveau module listed as “loaded” to check if the driver is in the initrd? Or are you talking about other parts of the stack?