Nvidia driver issues

So I am having a few issues with Nvidia and not sure what else to do. I think I have the right drivers. I am running a desktop with a i9 with integrated graphics and then an RTX 4070 TI Super. I tried having both my displays hooked up to the 4070 because it should be able to handle it, however when my system boots, it only displays graphics on the integrated output. So right now I have one monitor plugged into the iGPU and one plugged into the dGPU. So that is a minor annoyance, but the iGPU performs way better than the dGPU.

First, the iGPU runs at 4k 144hz with no issues. The dGPU won’t go above 4k 60hz or I just get a black picture. The system sees the monitor but I can’t see anything on it.

Second, I take a lot of screenshots and when I try to take a screenshot, the dGPU monitor goes black for about 5 seconds, while the iGPU stays on.

Third, I use a physical KVM switch and occasionally (Not as much today though), when I switch back over, the desktop stays black on the dGPU monitor and the system stutters extremely bad, until I unplug the nvidia monitor. The only fix I have seen is to reboot the system because if I plug the monitor back in, it goes black and everything stutters again.

I would love some help with this. I have checked the sys files and modeset is enabled along with fbdev. I am running what I think are the latest drivers per the Arch installation setup (565.77).

I know Nvidia isn’t the best on Linux, but I didn’t think it was this bad.

Here is my inxi:

System:
  Kernel: 6.12.4-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: acpi_pm parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux
    root=UUID=6a78cf0a-6b26-44ce-b1d1-bc64b7d38376 rw rootflags=subvol=@
    nowatchdog nvme_load=YES rd.luks.uuid=40fc2511-ca20-49e8-897d-9dabf5b24a5c
    loglevel=3
  Desktop: KDE Plasma v: 6.2.4 tk: Qt v: N/A info: frameworks v: 6.8.0
    wm: kwin_wayland vt: 1 dm: SDDM Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Desktop System: Dell product: XPS 8960 v: N/A
    serial: <superuser required> Chassis: type: 3 serial: <superuser required>
  Mobo: Dell model: 09M47G v: A00 serial: <superuser required> part-nu: 0BC0
    uuid: <superuser required> UEFI: Dell v: 2.12.0 date: 09/18/2024
Battery:
  ID-1: hidpp_battery_0 charge: 96% condition: N/A volts: 4.1 min: N/A
    model: Logitech G502 LIGHTSPEED Wireless Gaming Mouse type: N/A
    serial: <filter> status: discharging
CPU:
  Info: model: Intel Core i9-14900K bits: 64 type: MST AMCP arch: Raptor Lake
    gen: core 14 level: v3 note: check built: 2022+ process: Intel 7 (10nm)
    family: 6 model-id: 0xB7 (183) stepping: 1 microcode: 0x12B
  Topology: cpus: 1x dies: 1 clusters: 12 cores: 24 threads: 32 mt: 8 tpc: 2
    st: 16 smt: enabled cache: L1: 2.1 MiB desc: d-16x32 KiB, 8x48 KiB; i-8x32
    KiB, 16x64 KiB L2: 32 MiB desc: 8x2 MiB, 4x4 MiB L3: 36 MiB desc: 1x36 MiB
  Speed (MHz): avg: 799 min/max: 800/5700:6000:4300 scaling:
    driver: intel_pstate governor: powersave cores: 1: 799 2: 799 3: 799 4: 799
    5: 799 6: 799 7: 799 8: 799 9: 799 10: 799 11: 799 12: 799 13: 799 14: 799
    15: 799 16: 799 17: 799 18: 799 19: 799 20: 799 21: 799 22: 799 23: 799
    24: 799 25: 799 26: 799 27: 799 28: 799 29: 799 30: 799 31: 799 32: 799
    bogomips: 204032
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling mitigation: Clear Register File
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS; IBPB: conditional;
    RSB filling; PBRSB-eIBRS: SW sequence; BHI: BHI_DIS_S
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Raptor Lake-S GT1 [UHD Graphics 770] vendor: Dell
    driver: i915 v: kernel alternate: xe arch: Gen-13 process: Intel 7 (10nm)
    built: 2022+ ports: active: DP-4 empty: HDMI-A-2 bus-ID: 00:02.0
    chip-ID: 8086:a780 class-ID: 0300
  Device-2: NVIDIA AD103 [GeForce RTX 4070 Ti SUPER] vendor: Dell
    driver: nvidia v: 565.77 alternate: nouveau,nvidia_drm non-free: 550.xx+
    status: current (as of 2024-09) arch: Lovelace code: AD1xx
    process: TSMC n4 (5nm) built: 2022+ pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s ports: active: none off: DP-2
    empty: DP-1,DP-3,HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:2705 class-ID: 0300
  Device-3: Logitech C920 PRO HD Webcam driver: snd-usb-audio,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-13.2:45
    chip-ID: 046d:08e5 class-ID: 0102 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.14 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia
    alternate: fbdev,intel,nouveau,nv,vesa dri: iris gpu: i915,nvidia
    d-rect: 7680x2160 display-ID: 0
  Monitor-1: DP-2 pos: right res: 3840x2160 size: N/A modes: N/A
  Monitor-2: DP-4 pos: primary,left res: 3840x2160 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: intel iris drv: nvidia platforms: device: 0
    drv: nvidia gbm: drv: nvidia surfaceless: drv: nvidia wayland: drv: iris x11:
    drv: iris
  API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: intel mesa v: 24.3.1-arch1.3
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel Graphics (RPL-S)
    device-ID: 8086:a780 memory: 15.15 GiB unified: yes display-ID: :1.0
  API: Vulkan v: 1.4.303 layers: 1 device: 0 type: discrete-gpu name: NVIDIA
    GeForce RTX 4070 Ti SUPER driver: N/A device-ID: 10de:2705
    surfaces: xcb,xlib,wayland

PS. this is a work desktop, and we were told we could install Linux on it. I run EndeavourOS on my laptop and love it. I did not get a choice on the GPU, but sadly, I would have still stuck with the 4070 as we do password cracking and the nvidia cards are way better with the cuda cores than AMD is.

If all needed nvidia related packages are basically OK, then I’d suggest two alternative approaches:

  1. Simply blacklist i915 with a kernel parameter.
  2. Use something to switch the GPUs.

Alternative 2) can be implemented with (for example):
a) package nvidia-prime
b) package envycontrol

You’ll find more details in the EndeavourOS wiki and the Arch wiki.

This didn’t work for me. First, I did the recommended arch method via section 1.7 from https://wiki.archlinux.org/title/NVIDIA/Troubleshooting. That didn’t work, when Grub comes up only the intel monitor has display for me to enter my LUKS password, then it goes into grub and the boot up process all on Intel. When SDDM loads, and the login screen shows, it shows up on the Nvidia display. Once I log in, the Nvidia display is completely black and I can’t see any window on it, I can see my mouse though, which is weird.

Looking at the Display Configuration in settings, the Intel monitor is now shown at “Unknown-1”.

I also installed the nvidia-prime package and installed envycontrol and set it to use the nvidia drivers, that did not appear to work either as the intel drivers where still loaded and still required just like above in order to boot as nothing is letting the boot process use the Nvidia drivers.

Update: I don’t know what I just did, but I rebooted with both monitors plugged into the Nvidia GPU and waited about a minute, still nothing on the screens but I typed my LUKS password and waiting about 3 minutes and the system came up. The desktop took way longer to load for some reason, but I might have it up now. Would be nice to see the password request from grub though.

Now anytime I switch back using my KVM the screens say no display and stay back. I have to turn off a monitor and turn it back on for the computer to output the display. I have sleep and screen saver turned off. Not sure why it is doing that.