How to add nvidia-drm.modeset=1 kernel parameter?

you have Hybrid graphics, the kernel parameters not work with this

modeset is loaded correctly

2 Likes
cat /etc/default/grub | grep GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash loglevel=3 udev.log_priority=3 vt.global_cursor_default=0 resume=/dev/sda4 resum
e_offset=1363968"

Yes, the same for Wayland:

 Display: wayland server: X.org v: 1.21.1.9 with: Xwayland v: 23.2.2
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa dri: iris gpu: i915,nvidia display-ID: 0

I have read the Arch Wiki article about Intel and its settings and there is no word about setting it for default usage. However, from what I could understand by reading between lines, if Intel is detected on a system and is not blacklisted in confs, it will always run by default. Correct me if I’m wrong.

So hybrid setup is basically a typical intel setup (no blacklisted intel/modesetting) which works out of the box, without telling system to use it, plus loaded nvidia modules from /etc/modules-load.d/ confs (in our case mhwd-gpu.conf which adds nvidia and nvidia-drm modules). Then when nvidia is asked to be used by prime-run, because modules are loaded, it is used for specified app/window.

Wayland doesn’t use directly /etc/X11/ confs but kernel mode settings, which run intel GPU by default (again if not disabled by some kernel parameters).

So again, if multimonitor is not working on Wayland, there is some kernel parameter or maybe some esoteric conf, or hook, or module loaded (or not loaded) that prevents it from working correctly, when additional monitor is plugged in. So I need to look up for all kernel parameters…

Note, that my system is 8 or 9 years old, meaning, I installed it so long ago, so maybe some setting is not brought up to date, hence this issue. However, somehow, optimus-manager was making it work, which puzzles me, because it wasn’t changing kernel parameters, only etc/X11 confs and was NOT WORKING on Wayland and yet, it made Wayland work correctly with secondary monitors. This would point to some X11 conf that was somehow playing along with the wider system graphical setup. That is why I used the same conf as optimus-manager, but that didn’t yield the same result, meaning all worked fine, aside the multimonitors.

I’m currently testing it. So modeset does not work under wayland. All known options to activate modeset end in a black screen

sudo cat /sys/module/nvidia_drm/parameters/modeset                              1 ✘ 
[sudo] Passwort für weingeist: 
N
inxi -G                                                                    ✔  5s  
Graphics:
  Device-1: Intel Raptor Lake-P [Iris Xe Graphics] driver: i915 v: kernel
  Device-2: NVIDIA AD106M [GeForce RTX 4070 Max-Q / Mobile] driver: nvidia
    v: 545.29.06
  Device-3: SunplusIT FHD Webcam driver: uvcvideo type: USB
  Display: wayland server: X.org v: 1.21.1.9 with: Xwayland v: 23.2.2
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915,nvidia resolution: 2560x1600
  API: EGL v: 1.5 drivers: iris,nvidia,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: intel mesa v: 23.1.9-manjaro1.1
    renderer: Mesa Intel Graphics (RPL-P)
  API: Vulkan v: 1.3.269 drivers: nvidia surfaces: xcb,xlib,wayland

ou can test this

https://www.reddit.com/r/archlinux/comments/14sh3np/comment/jr0q2q6/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Looks like we have a similar setup, with a difference that your dGPU is much newer, so is the screen. The rest is the same.

Do you have a secondary monitor? Does it work for you under Wayland?

Thanks. That confirms some of my suspitions. In theory, Wayland should not care about X11 confs, but it does. So I assumed that SDDM is run by X11 by default and that is why any X11 config errors result in no graphical environment. I wondered how to switch SDDM to Wayland, as it should be stable for me.

I’ll test this when I find some time. Today’s nearly bedtime, so no time for such experiments.

there is a Problem

prime-run vainfo                                                                  ✔ 
Trying display: wayland
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.3.5 ()
vainfo: Supported profile and entrypoints

is the same

vainfo                                                                            ✔ 
Trying display: wayland
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.3.5 ()
vainfo: Supported profile and entrypoints

prime-run firefox works with intel

are

prime-run glxgears -info                                                      255 ✘ 
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER   = NVIDIA GeForce RTX 4070 Laptop GPU/PCIe/SSE2
GL_VERSION    = 4.6.0 NVIDIA 545.29.06
GL_VENDOR     = NVIDIA Corporation

what is broken

no other Monitor sorry

Maybe there is some additional condition that makes only apps using graphics 3D renderers to use Nvidia when prime-run is invoked?

I have the same result with prime-run vainfo and vainfo, but steam can be run with Nvidia with prime run, the same as this:

prime-run glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0x1d1 (8/8/8/0)
Visual ID of window: 0x40e
Context is Direct
OpenGL Renderer: NVIDIA GeForce GTX 970M/PCIe/SSE2

So Nvidia works when it is needed.

One of such hidden conditions is Vulkan itself. If you launch any game in Vulkan (so basically what all Proton games are doing), it will use Nvidia, even if prime-run is not used.

Thank you for clearing that up. I have noticed this in steam, no prime-run but still use Nvidia, but could not figure out WHY.
I read somewhere that prime-run basically just sets a few env variables.

Since you figured out that the nvidia configs ARE being used, have you tried to configure the config for dual gpus with prime? Bus id:s and all.
nvidia-xconfig has a SH**LOAD of options.

About external monitors, you might have to reroute the signal to all ports with reverse prime.
But with wayland, yeah, I do not look forward to next KDE.
You can take a look at this: Chapter 33. Offloading Graphics Display with RandR 1.4

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.