I'm trying to get this running on AMD iGPU, but always ends up with black screen when trying to run the vm.
I've modified start/stop functions a bit based on what I've found, but still no luck.
Start:
#!/bin/bash
# Helpful to read output when debugging
set -x
# Stop display manager
rc-config stop display-manager
# Uncomment the following line if you use GDM
#killall gdm-x-session
# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind
# Unbind EFI-Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Avoid a Race condition by waiting 2 seconds. This can be calibrated to be shorter or longer if required for your system
sleep 2
# Unbind the GPU from display driver
virsh nodedev-detach pci_0000_09_00_0
virsh nodedev-detach pci_0000_09_00_1
modprobe -r amdgpu
# Load VFIO Kernel Module
modprobe vfio
modprobe vfio-pci
modprobe vfio_iommu_type1
Revert:
#!/bin/bash
set -x
source "/etc/libvirt/hooks/kvm.conf"
modprobe -r vfio_pci
modprobe -r vfio_iommu_type1
modprobe -r vfio
# Re-Bind GPU to Nvidia Driver
virsh nodedev-reattach pci_0000_09_00_0
# Re-scan PCI devices
echo 1 | tee /sys/bus/pci/rescan
# Reload nvidia modules
modprobe amdgpu
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# Rebind VT consoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
# Restart Display Manager
rc-config start display-manager
VM:
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
<name>video</name>
<uuid>0ae90b2e-5210-4cdb-8104-8a8023ea61c8</uuid>
<memory unit="KiB">6291456</memory>
<currentMemory unit="KiB">6291456</currentMemory>
<vcpu placement="static">16</vcpu>
<os firmware="efi">
<type arch="x86_64" machine="pc-q35-4.2">hvm</type>
<firmware>
<feature enabled="no" name="enrolled-keys"/>
<feature enabled="no" name="secure-boot"/>
</firmware>
<loader readonly="yes" type="pflash" format="raw">/usr/share/qemu/edk2-x86_64-code.fd</loader>
<nvram template="/usr/share/qemu/edk2-i386-vars.fd" templateFormat="raw" format="raw">/home/damiandudycz/Virtual-Machines/macOS/video_VARS-video.fd</nvram>
<boot dev="hd"/>
<bootmenu enable="no"/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on"/>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/home/damiandudycz/Virtual-Machines/macOS/MacintoshHD"/>
<target dev="sda" bus="sata"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
<controller type="sata" index="0">
<address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
</controller>
<controller type="pci" index="0" model="pcie-root"/>
<controller type="pci" index="1" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="1" port="0x8"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on"/>
</controller>
<controller type="pci" index="2" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="2" port="0x9"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
</controller>
<controller type="pci" index="3" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="3" port="0xa"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
</controller>
<controller type="pci" index="4" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="4" port="0xb"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x3"/>
</controller>
<controller type="pci" index="5" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="5" port="0xc"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x4"/>
</controller>
<controller type="pci" index="6" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="6" port="0xd"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x5"/>
</controller>
<controller type="pci" index="7" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="7" port="0xe"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x6"/>
</controller>
<controller type="pci" index="8" model="pcie-root-port">
<model name="pcie-root-port"/>
<target chassis="8" port="0xf"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x7"/>
</controller>
<controller type="pci" index="9" model="pcie-to-pci-bridge">
<model name="pcie-pci-bridge"/>
<address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
</controller>
<controller type="virtio-serial" index="0">
<address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
</controller>
<controller type="usb" index="0" model="qemu-xhci" ports="15">
<address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</controller>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<audio id="1" type="none"/>
<hostdev mode="subsystem" type="pci" managed="yes">
<source>
<address domain="0x0000" bus="0x09" slot="0x00" function="0x0"/>
</source>
<rom bar="on"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</hostdev>
<watchdog model="itco" action="reset"/>
<memballoon model="none"/>
</devices>
<qemu:commandline>
<qemu:arg value="-device"/>
<qemu:arg value="isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/>
<qemu:arg value="-smbios"/>
<qemu:arg value="type=2"/>
<qemu:arg value="-usb"/>
<qemu:arg value="-device"/>
<qemu:arg value="usb-tablet"/>
<qemu:arg value="-device"/>
<qemu:arg value="usb-kbd"/>
<qemu:arg value="-cpu"/>
<qemu:arg value="Haswell-noTSX,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"/>
</qemu:commandline>
</domain>
Start and revert functions seems to work at least to some point. Start makes screen go black, stop restores it correctly. The only issue I can see with them is ./start.sh: line 15: echo: write error: No such device.
Anything I can do to proceed with this?
I'm trying to get this running on AMD iGPU, but always ends up with black screen when trying to run the vm.
I've modified start/stop functions a bit based on what I've found, but still no luck.
Start:
Revert:
VM:
Start and revert functions seems to work at least to some point. Start makes screen go black, stop restores it correctly. The only issue I can see with them is
./start.sh: line 15: echo: write error: No such device.Anything I can do to proceed with this?