Use mux switch instead of going through iGPU

Context: I am trying to passthrough my iGPU to a QEMU/KVM VM. When I do so, my laptop screen goes black, which tells me that the mux switch that my laptop has isn’t used
Makes sense I guess, since I’m using Reverse PRIME to render everything with my dGPU!

So my question is, how can I use my dGPU to render everything on the host (I had issues with hybrid graphics) and have the output go through the mux directly so that I can passthrough my iGPU without an issue? Thanks in advance!

xorg conf that I use to use dGPU with everything

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

inxi

System:
  Kernel: 5.15.32-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=97dd37d5-1395-4fe9-91a1-5c5335a75b8a rw nouveau.modeset=0 quiet
    splash apparmor=1 security=apparmor udev.log_priority=3
  Desktop: GNOME v: 41.5 tk: GTK v: 3.24.33 wm: gnome-shell dm: GDM v: 41.3
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Strix G733ZW_G733ZW v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: G733ZW v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: G733ZW.303 date: 12/27/2021
Battery:
  ID-1: BAT0 charge: 86.9 Wh (100.0%) condition: 86.9/90.0 Wh (96.6%)
    volts: 17.3 min: 15.9 model: AS3GWYF3KC GA50358 type: Unknown
    serial: <filter> status: full
Memory:
  RAM: total: 31.02 GiB used: 3.97 GiB (12.8%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: 12th Gen Intel Core i9-12900H bits: 64 type: MST AMCP
    arch: Alder Lake family: 6 model-id: 0x9A (154) stepping: 3 microcode: 0x413
  Topology: cpus: 1x cores: 14 mt: 6 tpc: 2 st: 8 threads: 20 smt: enabled
    cache: L1: 1.2 MiB desc: d-8x32 KiB, 6x48 KiB; i-6x32 KiB, 8x64 KiB
    L2: 11.5 MiB desc: 6x1.2 MiB, 2x2 MiB L3: 24 MiB desc: 1x24 MiB
  Speed (MHz): avg: 763 high: 1222 min/max: 400/6300:6400:3800 scaling:
    driver: intel_pstate governor: powersave cores: 1: 624 2: 904 3: 678 4: 497
    5: 881 6: 722 7: 668 8: 806 9: 1088 10: 604 11: 508 12: 734 13: 796
    14: 1222 15: 1015 16: 702 17: 621 18: 856 19: 662 20: 675 bogomips: 116780
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_lbr arch_perfmon art avx avx2 avx_vnni bmi1 bmi2 bts
    cat_l2 cdp_l2 clflush clflushopt clwb 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 fsrm fxsr gfni ht hwp
    hwp_act_window hwp_epp hwp_notify hwp_pkg_req ibpb ibrs ibrs_enhanced ida
    intel_pt invpcid invpcid_single lahf_lm lm mca mce md_clear mmx monitor
    movbe movdir64b movdiri msr mtrr nonstop_tsc nopl nx ospke pae pat pbe
    pcid pclmulqdq pconfig pdcm pdpe1gb pebs pge pku pln pni popcnt pse pse36
    pts rdpid rdrand rdseed rdt_a rdtscp rep_good sdbg sep serialize sha_ni
    smap smep smx split_lock_detect ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp
    syscall tm tm2 tme tpr_shadow tsc tsc_adjust tsc_deadline_timer
    tsc_known_freq umip vaes vme vmx vnmi vpclmulqdq vpid waitpkg x2apic
    xgetbv1 xsave xsavec xsaveopt xsaves xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 status: Vulnerable: eIBRS with unprivileged eBPF
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Alder Lake-P Integrated Graphics vendor: ASUSTeK
    driver: i915 v: kernel ports: active: eDP-1 empty: DP-1,DP-2
    bus-ID: 0000:00:02.0 chip-ID: 8086:46a6 class-ID: 0300
  Device-2: NVIDIA GA104 [Geforce RTX 3070 Ti Laptop GPU] vendor: ASUSTeK
    driver: nvidia v: 470.103.01 alternate: nouveau,nvidia_drm
    bus-ID: 0000:01:00.0 chip-ID: 10de:24a0 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.3 with: Xwayland v: 22.1.1
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa gpu: i915 display-ID: :1 screens: 1
  Screen-1: 0 s-res: 4480x1440 s-dpi: 96 s-size: 1185x381mm (46.65x15.00")
    s-diag: 1245mm (49.01")
  Monitor-1: HDMI-0 pos: bottom-r res: 1920x1080 hz: 60 dpi: 102
    size: 477x268mm (18.78x10.55") diag: 547mm (21.54") modes: N/A
  Monitor-2: eDP-1-1 pos: primary,top-left res: 2560x1440 hz: 240 dpi: 171
    size: 381x214mm (15x8.43") diag: 437mm (17.2") modes: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 3070 Ti Laptop GPU/PCIe/SSE2
    v: 4.6.0 NVIDIA 470.103.01 direct render: Yes
Audio:
  Device-1: Intel Alder Lake PCH-P High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel alternate: snd_sof_pci_intel_tgl
    bus-ID: 0000:00:1f.3 chip-ID: 8086:51c8 class-ID: 0403
  Device-2: NVIDIA GA104 High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel bus-ID: 0000:01:00.1 chip-ID: 10de:228b
    class-ID: 0403
  Sound Server-1: ALSA v: k5.15.32-1-MANJARO running: yes
  Sound Server-2: sndio v: N/A running: no
  Sound Server-3: JACK v: 1.9.20 running: no
  Sound Server-4: PulseAudio v: 15.0 running: yes
  Sound Server-5: PipeWire v: 0.3.49 running: yes
Network:
  Device-1: Intel Alder Lake-P PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 0000:00:14.3 chip-ID: 8086:51f0 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Realtek RTL8125 2.5GbE vendor: ASUSTeK driver: r8169 v: kernel
    port: 3000 bus-ID: 0000:2c:00.0 chip-ID: 10ec:8125 class-ID: 0200
  IF: enp44s0 state: down mac: <filter>
  IF-ID-1: br-e4dce6a69314 state: down mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  IF-ID-2: docker0 state: down mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  IF-ID-3: virbr0 state: down mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel type: USB driver: btusb v: 0.8 bus-ID: 3-10:4
    chip-ID: 8087:0033 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd
    v: 0.6 port: N/A bus-ID: 0000:00:0e.0 chip-ID: 8086:467f rev: class-ID: 0104
Drives:
  Local Storage: total: 953.87 GiB used: 776.05 GiB (81.4%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: 3400 MTFDKBA1T0TFH
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: P7MA001 temp: 44.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 953.57 GiB size: 937.61 GiB (98.33%)
    used: 776.05 GiB (82.8%) fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:2
    label: N/A uuid: 97dd37d5-1395-4fe9-91a1-5c5335a75b8a
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 288 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
    label: NO_LABEL uuid: 0641-9146
Swap:
  Alert: No swap data was found.
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 1 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 2-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 20 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 3-2:2 info: Razer USA DeathAdder Elite type: Mouse,Keyboard
    driver: hid-generic,usbhid interfaces: 3 rev: 2.0 speed: 12 Mb/s
    power: 500mA chip-ID: 1532:005c class-ID: 0300
  Device-2: 3-3:3 info: ASUSTek N-KEY Device type: Keyboard
    driver: asus,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 0b05:19b6 class-ID: 0301
  Device-3: 3-10:4 info: Intel type: Bluetooth driver: btusb interfaces: 2
    rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 8087:0033 class-ID: e001
  Hub-4: 4-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 27.8 C mobo: N/A gpu: nvidia temp: 40 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 427 Uptime: 28m wakeups: 2 Init: systemd v: 250 tool: systemctl
  Compilers: gcc: 11.2.0 clang: 13.0.1 Packages: 1697 pacman: 1675 lib: 506
  flatpak: 13 snap: 9 Shell: Zsh v: 5.8.1 running-in: gnome-terminal
  inxi: 3.3.15
1 Like

Thanks, it was a nice tutorial but it didn’t work (no GPU in the guest VM, though the host can still use it at least) and I now don’t have an output on my second monitor :smile:
I’m also still interested in knowing how to use my mux switch

I suggest you go through this:

PCI passthrough via OVMF - ArchWiki

Start with the prerequisites.
That is where it quickly ended before it really began for me. :wink:
Most laptops are not capable …

1 Like