Cannot start X when nvidia kernel mode setting (DRM) is enabled in commandline

Inxi…

System:
  Kernel: 5.15.50-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=f87ef1fe-5eec-4ec5-b98c-105742ac8e6d rw quiet
    sysrq_always_enabled=1 mitigations=off nowatchdog pci=noaer
    cpufreq.default_governor=performance apparmor=1 security=apparmor
    udev.log_priority=3 acpi_osi=! acpi_osi=Linux "acpi_osi=Windows 2009"
    nogpumanager intel_idle.max_cstate=1 i915.enable_gvt=1 i915-enable_fbc=1
    pcie_port_pm=off iommu=pt intel_iommu=on kvm.ignore_msrs=1
    rd.driver.pre=vfio-pci default_hugepagesz=1G hugepagesz=1G hugepages=0
    transparent_hugepage=never
  Desktop: KDE Plasma v: 5.24.5 tk: Qt v: 5.15.5 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: Micro-Star product: GE75 Raider 8SE v: REV:1.0
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Micro-Star model: MS-17E2 v: REV:1.0 serial: <superuser required>
    UEFI: American Megatrends v: E17E2IMS.11A date: 05/19/2020
Battery:
  ID-1: BAT1 charge: 21.5 Wh (51.2%) condition: 42.0/53.4 Wh (78.5%)
    volts: 10.9 min: 10.9 model: MSI BIF0_9 type: Li-ion serial: N/A status: N/A
  Device-1: hidpp_battery_0
    model: Logitech MX Vertical Advanced Ergonomic Mouse serial: <filter>
    charge: 10% (should be ignored) rechargeable: yes status: discharging
Memory:
  RAM: total: 31.19 GiB used: 3.67 GiB (11.8%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Coffee Lake
    gen: core 8 built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158)
    stepping: 0xA (10) microcode: 0xF0
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 9 MiB desc: 1x9 MiB
  Speed (MHz): avg: 3901 high: 3911 min/max: 800/4100 scaling:
    driver: intel_pstate governor: performance cores: 1: 3900 2: 3900 3: 3900
    4: 3901 5: 3911 6: 3900 7: 3902 8: 3903 9: 3905 10: 3900 11: 3901 12: 3900
    bogomips: 52815
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush clflushopt
    cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts
    epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu fsgsbase fxsr
    ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida intel_pt invpcid
    invpcid_single lahf_lm lm mca mce md_clear mmx monitor movbe mpx msr mtrr
    nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln
    pni popcnt pse pse36 pts rdrand rdseed rdtscp rep_good sdbg sep smap smep
    ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc
    tsc_adjust tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave
    xsavec xsaveopt xsaves xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: vulnerable
  Type: mds status: Vulnerable; SMT vulnerable
  Type: meltdown status: Vulnerable
  Type: mmio_stale_data status: Vulnerable
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 status: Vulnerable: __user pointer sanitization and
    usercopy barriers only; no swapgs barriers
  Type: spectre_v2 status: Vulnerable, IBPB: disabled, STIBP: disabled
  Type: srbds status: Vulnerable
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Micro-Star MSI
    driver: i915 v: kernel arch: Gen9.5 process: Intel 14nm built: 2016-20
    ports: active: eDP-1 empty: DP-1,HDMI-A-1 bus-ID: 00:02.0
    chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: Micro-Star MSI
    driver: nvidia v: 515.57 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-06) arch: Turing process: TSMC 12nm
    built: 2018-22 pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 01:00.0
    chip-ID: 10de:1f11 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.2
    compositor: kwin_x11 driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 model: AU Optronics 0x409d built: 2018 res: 1920x1080
    hz: 144 dpi: 128 gamma: 1.2 size: 382x215mm (15.04x8.46")
    diag: 438mm (17.3") ratio: 16:9 modes: 1920x1080
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 22.1.2
    direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    bus-ID: 00:1f.3 chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA TU106 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:10f9 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.50-1-MANJARO running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.52 running: yes
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi
    vendor: Rivet Networks Killer Wireless-AC 1550i Wireless driver: iwlwifi
    v: kernel bus-ID: 00:14.3 chip-ID: 8086:a370 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Qualcomm Atheros Killer E2500 Gigabit Ethernet
    vendor: Micro-Star MSI driver: alx v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: 3000 bus-ID: 05:00.0 chip-ID: 1969:e0b1 class-ID: 0200
  IF: enp5s0 state: down mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 2.07 TiB used: 1.85 TiB (89.0%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Kingston
    model: RBUSNS8154P3256GJ size: 238.47 GiB block-size: physical: 512 B
    logical: 512 B speed: 15.8 Gb/s lanes: 2 type: SSD serial: <filter>
    rev: E8FK11.C temp: 42.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
    model: WDS100T2B0B-00YS70 size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 00WD
    scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: KingSpec model: ACSC4M1TS25
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 4H scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 113.18 GiB size: 110.84 GiB (97.94%)
    used: 62.73 GiB (56.6%) fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:2
    label: root uuid: f87ef1fe-5eec-4ec5-b98c-105742ac8e6d
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 1.8 MiB (0.6%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1 label: EFI
    uuid: 2FA5-9041
  ID-3: /run/media/rabcor/86069E6C069E5D4D raw-size: 124.98 GiB
    size: 124.98 GiB (100.00%) used: 119.31 GiB (95.5%) fs: ntfs
    dev: /dev/nvme0n1p4 maj-min: 259:4 label: N/A uuid: 86069E6C069E5D4D
  ID-4: /run/media/rabcor/KingSpec raw-size: 953.87 GiB
    size: 953.4 GiB (99.95%) used: 812.8 GiB (85.3%) fs: xfs dev: /dev/sdb1
    maj-min: 8:17 label: N/A uuid: 7081018e-cce8-4d7d-b093-bb681ff46b8e
  ID-5: /run/media/rabcor/WD raw-size: 931.51 GiB size: 931.51 GiB (100.00%)
    used: 896.21 GiB (96.2%) fs: f2fs dev: /dev/sda1 maj-min: 8:1
    label: Western Digital uuid: ae81d12d-6838-4833-b47b-8dd120364382
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 512 MiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
Unmounted:
  ID-1: /dev/nvme0n1p3 maj-min: 259:3 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-2:2 info: Logitech Unifying Receiver type: Keyboard,Mouse,HID
    driver: logitech-djreceiver,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s
    power: 98mA chip-ID: 046d:c52b class-ID: 0300
  Device-2: 1-7:3 info: Realtek RTS5129 Card Reader Controller
    type: <vendor specific> driver: rtsx_usb,rtsx_usb_ms,rtsx_usb_sdmmc
    interfaces: 1 rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 0bda:0129
    class-ID: ff00 serial: <filter>
  Device-3: 1-9:4 info: SteelSeries ApS KLC type: HID
    driver: hid-generic,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s
    power: 300mA chip-ID: 1038:1122 class-ID: 0300
  Hub-2: 2-0:1 info: Super-speed hub ports: 8 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 61.0 C pch: 51.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 335 Uptime: 15m wakeups: 3 Init: systemd v: 251
  default: graphical tool: systemctl Compilers: gcc: 12.1.0 alt: 11
  clang: 13.0.1 Packages: pacman: 1481 lib: 487 flatpak: 0 Shell: Bash
  v: 5.1.16 running-in: konsole inxi: 3.3.19

I’ve run into a problem where my system freezes if I run certain video games without Vsync enabled when using Prime offloading.

After some digging I found out that prime-synchronization does not seem to be enabled for my main display and trying to enable it nets me this:

$ xrandr --output eDP-1 --set "PRIME Synchronization" 1X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  11 (RRQueryOutputProperty)
  Serial number of failed request:  50
  Current serial number in output stream:  50

My first guess is that it requires nvidia drm to be enabled, which is where I encounter this weird issue, currently without the commandline option to enable nvidia drm it seems like it is enabled:

$ journalctl -b 0 | grep drm
júl 04 21:57:41 Thulebox systemd[1]: Starting Load Kernel Module drm...
júl 04 21:57:41 Thulebox systemd[1]: modprobe@drm.service: Deactivated successfully.
júl 04 21:57:41 Thulebox systemd[1]: Finished Load Kernel Module drm.
júl 04 21:57:42 Thulebox kernel: i915 0000:00:02.0: [drm] VT-d active for gfx access
júl 04 21:57:42 Thulebox kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
júl 04 21:57:42 Thulebox kernel: [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
júl 04 21:57:42 Thulebox kernel: fbcon: i915drmfb (fb0) is primary device
júl 04 21:57:42 Thulebox kernel: i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
júl 04 21:57:42 Thulebox kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
júl 04 21:57:42 Thulebox kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
júl 04 21:57:42 Thulebox systemd-modules-load[317]: Inserted module 'nvidia_drm'
júl 04 22:03:21 Thulebox kernel: i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe A (start=50809 end=50810) time 718 us, min 1062, max 1079, scanline start 975, end 1078

However, if I update grub to include nvidia-drm.modeset=1 and restart, X will fail to launch.

Here is a link to the Xorg log file for the failed launch: Hastebin: Send and Save Text or Code Snippets for Free | Toptal®

Same here,

I was trying to put
nvidia-drm.modeset=1 in /etc/default/grub,
or
options nvidia_drm modeset=1 in /etc/modprobe.d/nvidia-drm.conf

but when restarting, lightdm fails to init

I need this to use GitHub - elFarto/nvidia-vaapi-driver: A VA-API implemention using NVIDIA's NVDEC on firefox.