Failed MacOS KVM Single GPU Passthrough.

This page summarizes the projects mentioned and recommended in the original post on /r/VFIO

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • macOS-Simple-KVM

    Tools to set up a quick macOS VM in QEMU, accelerated by KVM.

  • I region up a MacOS KVM using https://github.com/foxlet/macOS-Simple-KVM. After doing so I went through the steps here https://github.com/joeknock90/Single-GPU-Passthrough for single gpu passthrough. I am using MacOS High Sierra because I have a GTX 1060 3gb, and also passed through a patched rom. However, as far as I can tell, the script only gets up to shutting off the display manager before starting up again. I'm relatively new to this, so help would be appreciated. Here is the start.sh script: #debugging set -x # load variables we defined source "/etc/libvirt/hooks/kvm.conf" ‍ # stop display manager systemctl stop sddm.service # Unbind VTconsoles echo 0 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind #Unbind EFI-framebuffer echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind # Avoid race condition sleep 10 #Unload NVIDIA modprobe -r nvidia_drm modprobe -r nvidia_modeset modprobe -r drm_kms_helper modprobe -r nvidia modprobe -r i2c_nvidia_gpu modprobe -r drm modprobe -r nvidia_uvm # unbind gpu virsh nodedev-detach $VIRSH_GPU_VIDEO virsh nodedev-detach $VIRSH_GPU_AUDIO #load vfio modprobe vfio modprobe vfio_pci modprobe vfio_iommu_type1 Revert.sh: # Debug set -x # Load variables source /etc/libvirt/hooks/kvm.conf # unload vfio-pci modprobe -r vfio_pci modprobe -r vfio_iommu_type1 modprobe -r vfio # Rebind gpu virsh nodedev-reattach $VIRSH_GPU_VIDEO virsh nodedev-reattach $VIRSH_GPU_AUDIO # Rebind VTconsoles echo 1 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind # Read nvidia x config nvidia-xconfig --query-gpu-info > /dev/null 2>&1 # Bind EFI-framebuffer echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind # Load nvidia modprobe nvidia_drm modprobe nvidia_modeset modprobe drm_kms_helper modprobe nvidia modprobe drm modprobe nvidia_uvm #Restart Display Service systemctl start sddm.service The only thing I changed in the XML file is passing through the rom. EDIT:The scripts themselves work fine, I'm assuming the virtual machine configuration is wrong and thats whats messing things up. EDIT 2: After a few hours I finally figured it out. The cpu configuration was not supported; I attempted to pass through 6 cores, 2 threads each or 12 threads, but it didn't work. When I turned it down to 8 it worked. However, seeing as cpu performance in the vm was significantly slower than on host or even other vm's, I'm wondering how I can passthrough more threads.

  • Single-GPU-Passthrough

  • I region up a MacOS KVM using https://github.com/foxlet/macOS-Simple-KVM. After doing so I went through the steps here https://github.com/joeknock90/Single-GPU-Passthrough for single gpu passthrough. I am using MacOS High Sierra because I have a GTX 1060 3gb, and also passed through a patched rom. However, as far as I can tell, the script only gets up to shutting off the display manager before starting up again. I'm relatively new to this, so help would be appreciated. Here is the start.sh script: #debugging set -x # load variables we defined source "/etc/libvirt/hooks/kvm.conf" ‍ # stop display manager systemctl stop sddm.service # Unbind VTconsoles echo 0 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind #Unbind EFI-framebuffer echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind # Avoid race condition sleep 10 #Unload NVIDIA modprobe -r nvidia_drm modprobe -r nvidia_modeset modprobe -r drm_kms_helper modprobe -r nvidia modprobe -r i2c_nvidia_gpu modprobe -r drm modprobe -r nvidia_uvm # unbind gpu virsh nodedev-detach $VIRSH_GPU_VIDEO virsh nodedev-detach $VIRSH_GPU_AUDIO #load vfio modprobe vfio modprobe vfio_pci modprobe vfio_iommu_type1 Revert.sh: # Debug set -x # Load variables source /etc/libvirt/hooks/kvm.conf # unload vfio-pci modprobe -r vfio_pci modprobe -r vfio_iommu_type1 modprobe -r vfio # Rebind gpu virsh nodedev-reattach $VIRSH_GPU_VIDEO virsh nodedev-reattach $VIRSH_GPU_AUDIO # Rebind VTconsoles echo 1 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind # Read nvidia x config nvidia-xconfig --query-gpu-info > /dev/null 2>&1 # Bind EFI-framebuffer echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind # Load nvidia modprobe nvidia_drm modprobe nvidia_modeset modprobe drm_kms_helper modprobe nvidia modprobe drm modprobe nvidia_uvm #Restart Display Service systemctl start sddm.service The only thing I changed in the XML file is passing through the rom. EDIT:The scripts themselves work fine, I'm assuming the virtual machine configuration is wrong and thats whats messing things up. EDIT 2: After a few hours I finally figured it out. The cpu configuration was not supported; I attempted to pass through 6 cores, 2 threads each or 12 threads, but it didn't work. When I turned it down to 8 it worked. However, seeing as cpu performance in the vm was significantly slower than on host or even other vm's, I'm wondering how I can passthrough more threads.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts