我试图通过一个Radeon 5450 GPU从一个Ubuntu18.04热情片的胜利7客人。在使用virt管理器创建VM时,我使用的是机器类型的q35,因为我读到它应该更适合通过。当使用默认的pc-i440fx-仿生机器类型时,图形驱动程序会崩溃。当使用q35时,它不会崩溃,但是驱动程序不能分配资源。
下面是机器的定义。
我有卡片在05:00.0:
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series]当我安装AMD驱动程序(催化剂)时,驱动程序会安装,但是它不能分配IO范围和IRQ:
This device cannot find enough free resources that is can use (Code 12)
我的定义有什么问题?
win7-2
ae01eb73-b725-4abb-9ce2-d544393de40e
8290304
8290304
4
/machine
hvm
Opteron_G5
destroy
restart
destroy
/usr/bin/kvm-spice
libvirt-ae01eb73-b725-4abb-9ce2-d544393de40e
libvirt-ae01eb73-b725-4abb-9ce2-d544393de40e
+64055:+131
+64055:+131发布于 2018-08-23 19:16:29
从本教程开始,我得到了AMD5450主显卡的通过率(主机运行无头),使用下面的脚本。
apt-get install ovmf的OVMF图像)-vga qlx和以后的qlx监视器(显示设置)video=efifb:off添加到cmdline,否则efifb将在vfio之前获取PCI条。-vga qlx),则AMD5450不需要for文件。剧本:
#!/bin/bash
b=$(pwd)
passthrough=0
qxl=1
uefi=1
ovmf=0
net=0
while getopts "bpQUon" opt; do
case $opt in
p) passthrough=1 ;;
Q) qxl=0 ;;
U) uefi=0 ;;
n) net=1 ;;
o) ovmf=1 ;;
esac
done
cp ${b}/uefi/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd .
OPTS=""
# Basic CPU settings.
OPTS="$OPTS -cpu host,kvm=off"
OPTS="$OPTS -smp 4,sockets=1,cores=4,threads=1"
# Enable KVM full virtualization support.
OPTS="$OPTS -enable-kvm"
# Assign memory to the vm.
OPTS="$OPTS -m 4000"
# VFIO GPU and GPU sound passthrough.
if [ "$passthrough" == "1" ]; then
#,multifunction=on,romfile=/mnt/nvidia_efi.rom" ,romfile=${b}/bioses/XFX.HD5450.1024.110612.rom
#OPTS="$OPTS -device vfio-pci,host=05:00.0,multifunction=on,romfile=${b}/bioses/XFX.HD5450.1024.110612.rom"
#,romfile=${b}/bioses/XFX.HD5450.1024.110612_1.rom
OPTS="$OPTS -device vfio-pci,host=01:00.0,multifunction=on"
#,romfile=/mnt/data-n0/vms-win/romfile_radeon.bin
#,romfile=/mnt/nvidia_efi.rom"
OPTS="$OPTS -device vfio-pci,host=01:00.1"
fi
# Supply OVMF (general UEFI bios, needed for EFI boot support with GPT disks).
if [ "$uefi" == "1" ]; then
if [ "$ovmf" == "0" ]; then
OPTS="$OPTS -drive if=pflash,format=raw,readonly,file=${b}/uefi/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
OPTS="$OPTS -drive if=pflash,format=raw,file=${b}/OVMF_VARS-pure-efi.fd"
else
mkdir -p ${b}/hda-contents
#OPTS="$OPTS -pflash ${b}/ovmf_pkg/OVMF.fd"
OPTS="$OPTS -drive if=pflash,format=raw,readonly,file=${b}/ovmf_pkg/OVMF.fd"
OPTS="$OPTS -drive if=pflash,format=raw,file=${b}/OVMF_VARS-pure-efi.fd"
fi
fi
# Load our created VM image as a harddrive.
OPTS="$OPTS -hda ${b}/win10_uefi_cpu_host_qemu_vm.qcow2"
# Load our OS setup image e.g. ISO file.
#OPTS="$OPTS -cdrom ${b}/windows_10.iso"
OPTS="$OPTS -cdrom ${b}/virtio-win-0.1.141.iso"
if [ "$qxl" == "1" ]; then
# Use the following emulated video device (use none for disabled).
OPTS="$OPTS -vga qxl"
else
# Use an emulated video device (use none for disabled).
# -vga none -device qxl
OPTS="$OPTS -vga none -device qxl "
fi
OPTS="$OPTS -spice port=5900,addr=127.0.0.1,disable-ticketing "
# Redirect QEMU's console input and output.
OPTS="$OPTS -monitor stdio"
if [ "${net}" == "1" ]; then
# Improve the network performance by utilizing virtio-net.
OPTS="$OPTS -device virtio-net,netdev=net0,mac=de:ad:be:ef:33:4a"
OPTS="$OPTS -netdev tap,id=net0,ifname=vmtap0,script=./qemu-ifup,downscript=./qemu-ifdown"
else
OPTS="$OPTS -net none "
fi
#Bus 003 Device 004: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
#Bus 003 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
# USB mouse
if [ "$passthrough" == "1" ]; then
OPTS="$OPTS -usb"
OPTS="$OPTS -device usb-ehci,id=ehci"
OPTS="$OPTS -device usb-host,bus=usb-bus.0,vendorid=0x17ef,productid=0x6019 "
OPTS="$OPTS -device usb-host,bus=usb-bus.0,vendorid=0x1c4f,productid=0x0002 "
fi
#if [ "$passthrough" == "1" ]; then
# OPTS="$OPTS -usb"
# OPTS="$OPTS -device usb-ehci,id=ehci"
# OPTS="$OPTS -device usb-host,bus=usb-bus.0,vendorid=0x17ef,productid=0x6019 "
# OPTS="$OPTS -device usb-host,bus=usb-bus.0,vendorid=0x1c4f,productid=0x0002 "
#fi
#OPTS="$OPTS -device usb-host,hostbus=3,hostaddr=4"
#OPTS="$OPTS -device usb-host,hostbus=3,hostaddr=2"
#OPTS="$OPTS -device usb-host,bus=xhci.0,vendorid=0x1c4f,productid=0x0002 "
#OPTS="$OPTS -device usb-host,bus=xhci.0,vendorid=0x1a40,productid=0x0201 "
#OPTS="$OPTS -usbdevice host:1c4f:0002"
# USB keyboard
#OPTS="$OPTS -usbdevice host:1a40:0201"
sudo qemu-system-x86_64 $OPTShttps://askubuntu.com/questions/1065589
复制相似问题