Perplexity

To set up GPU pass-through on MX23 Linux using virt-manager to run a Garuda Linux virtual machine, follow these steps for best results and compatibility. This is a complex task that requires hardware virtualization support (IOMMU/VT-d for Intel, SVM/AMD-V for AMD CPUs), proper kernel parameters, and exact PCI binding steps.drakeor +2

Prerequisites

  • Ensure your CPU and motherboard support IOMMU (hardware virtualization). Check in your BIOS/UEFI for "VT-d" (Intel) or "SVM"/"AMD-V" (AMD) and enable these options.
  • Know your GPU's PCI IDs. Find with lspci -nn and note both the graphics and the related audio device IDs.youtube
  • Have two GPUs available (one for host, one for VM), or an integrated GPU for the host and a dedicated GPU for passthrough.github youtube

Kernel Parameters

  • For AMD, edit /etc/default/grub and set:
    text
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on"
    
  • For Intel, use:
    text
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on"
    
  • Update GRUB:
    text
    sudo update-grub
    
  • Reboot to activate these changes.drakeor +1

VFIO Driver Binding

  • You must bind the GPU you want to pass through to the vfio-pci driver.
  • This can be done statically through kernel module options or dynamically in scripts before VM starts.garudalinux +1
  • Example for modprobe:
    • Add to /etc/modprobe.d/vfio.conf:
      text
      options vfio-pci ids=<GPU_ID>,<AUDIO_ID>
      
  • You may also need to add these modules to initramfs or modprobe configuration based on Garuda's guide.garudalinux

Configuring virt-manager

  • In virt-manager, create a new VM and select UEFI as the firmware.
  • Under "Add Hardware", choose PCI Host Device and select your GPU and related audio component (PCI IDs match what you noted).youtube
  • If you use NVIDIA cards, add vendor hiding options in your VM XML to avoid "Error 43":
    text
    <features>
        <hyperv>
            <relaxed state="on"/>
            <vapic state="on"/>
            <spinlocks state="on" retries="8191"/>
            <vendor_id state="on" value="kvmhyperv"/>
        </hyperv>
        <kvm>
            <hidden state="on"/>
        </kvm>
    </features>
    
  • If virt-manager becomes unresponsive or your VM fails to start, verify PCI IDs are correct and modules are loaded as intended; check logs and try dynamic binding as described above.level1techs +1

Garuda-Specific Considerations

  • Some guides for Arch-based systems recommend modifying files that may not exist in Garuda (like /etc/mkinitcpio.conf). Garuda users may need to directly adjust initramfs or modprobe configs rather than relying on the Arch method.garudalinux
  • Troubleshooting may be needed for unique Garuda kernel/module behaviors. Use Garuda and Arch forums for specific help if stuck.garudalinux +1

Additional Resources

  • Video guides exist for MX Linux and Arch showing GPU pass-through configuration visually.youtube +2
  • Scripts and community tools may help automate driver binding and unbinding, especially for switching the GPU between host and guest on-demand.youtube github

GPU pass-through on MX23 Linux for a Garuda VM is possible but may require troubleshooting Garuda-specific boot/module differences and careful driver binding. Following these steps provides a solid foundation for a successful setup.garudalinux +1