0

I'm trying to get GPU passthrough to work on a VM. I've been following this video https://www.youtube.com/watch?v=6FI31QDtyy4. The differences between what I did and what he did in the video was modules in mkinitcpio config thingy, I used 'MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd)' instead because the video was a bit outdated.

So what I did was

  • Add intel_iommu=on in grub params
  • Checked that my system supports IOMMU, I ran 'dmesg | grep -e DMAR -e IOMMU'
  • Adding 'options vfio-pci ids=10de:10f0,10de:1b81' to vfio.conf
  • Modifying mkinitcpio.conf as described above
  • Running 'mkinitcpio -p linux'
  • Modifying qemu.conf (prob not related)
  • Running 'systemctl enable --now libvirtd' and 'systemctl enable virtlogd.socket'
  • Reboot and go back to Windows 10 (NOT DUALBOOTED. I'm running arch off a USB STICK (NOT LIVE USB)) (Tried adding a vm but failed because I didn't do the ntfs-3g thingy)
  • Came back from Windows 10 and added 'UUID=061A04D11A04C023 /media/Data/ ntfs-3g defaults 0 0' in fstab
  • Changed 'GRUB_CMDLINE_LINUX_DEFAULT="quiet"' to 'GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"' in /etc/default/grub
  • Rebooted and stuck at "Loading version 240 (when I remove the intel_iommu=on from params, it booted just fine)

First boot that iommu worked, I used my GPU as output. I tried iGPU after GPU didn't work on the last boot (No Signal). Also I've checked Arch's official wiki about PCI passthrough and the steps were pretty similiar

/etc/mkinitcpio.conf:

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd)

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

/etc/modprobe.d/vfio.conf:

options vfio-pci ids=10de:10f0,10de:1b81

Kernel version: 4.20.10-arch1-1-ARCH

Hardware info (lshw):

cube-arch                   
    description: Desktop Computer
    product: B360M-HD3 (Default string)
    vendor: Gigabyte Technology Co., Ltd.
    version: Default string
    serial: Default string
    width: 4294967295 bits
    capabilities: smbios-3.1 dmi-3.1 smp vsyscall32
    configuration: boot=normal chassis=desktop family=Default string sku=Default string uuid=E002D503-5E04-7905-ED06-310700080009
  *-core
       description: Motherboard
       product: B360M HD3
       vendor: Gigabyte Technology Co., Ltd.
       physical id: 0
       version: x.x
       serial: Default string
       slot: Default string
     *-firmware
          description: BIOS
          vendor: American Megatrends Inc.
          physical id: 0
          version: F4
          date: 04/19/2018
          size: 64KiB
          capacity: 15MiB
          capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int14serial int17printer acpi usb biosbootspecification uefi
     *-memory
          description: System Memory
          physical id: 3a
          slot: System board or motherboard
          size: 16GiB
        *-bank:0
             description: DIMM DDR4 Synchronous 2133 MHz (0.5 ns)
             product: F4-3000C16-8GISB
             vendor: Fujitsu
             physical id: 0
             serial: 00000000
             slot: ChannelA-DIMM0
             size: 8GiB
             width: 64 bits
             clock: 2133MHz (0.5ns)
        *-bank:1
             description: [empty]
             physical id: 1
             slot: ChannelA-DIMM1
        *-bank:2
             description: DIMM DDR4 Synchronous 2133 MHz (0.5 ns)
             product: F4-3000C16-8GISB
             vendor: Fujitsu
             physical id: 2
             serial: 00000000
             slot: ChannelB-DIMM0```
0

Solved

I was dumb, I plugged in my display to my GPU, after plugging it into iGPU it worked. Make sure to also make it primary output in your BIOS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.