Jump to content

[SOLVED] Ubuntu doesn't boot with GPU Passthrough


SnakeDrak

Recommended Posts

Hello community,

 

I am newbie with the virtualization in general. I have a home computer and I did 2 computer for gaming with 1 tower. Before unRaid I tried it with KVM but I migrate to unRaid because it is more easy and it saves time to me and effort.

 

Well, actually I have got two VMs with Windows 10 working successfully. My problem is with a Ubuntu VM. When I try to boot it I get a blocked screen:

ubuntu-gpu-1.thumb.jpeg.c57cfac5cc7a8f5daa0cf40259268815.jpegubuntu-gpu-2.thumb.jpeg.ff7d25e3d53751d4d5ffa90deeb98074.jpeg

 

I have tried several configurations. The GRUB is showing with the options to try Ubuntu and install it but any option goes frozen screen.

 

My first step was install Ubuntu but the GPU passthrough was not working so I installed it via VNC because when I tried to install Windows I had got problems with the GPU too similar to this one. My problem with Windows 10 was fixed waiting to the screen. After some minutes the screen was showed and I was be able to install Windows. In the first login I had got the same problem with my two Windows but now both ones are working correctly ever since.

 

So, this solutions is not worked with Ubuntu. I have installed it via VNC but with the GPU is not working, neither in the install process, neither after to be installed.

 

I don't know if the problem is with the GPU ROM or something like that (my graphic card have UEFI) but the Windows are working correctly. Or maybe the problem is with drivers and I should install the drivers via VNC...

 

I am using unRaid OS 6.3.5:

 

Quote

Version 6.3.5 2017-05-26
------------------------

Base distro:

- samba: 4.5.10 (CVE-2017-7494)

Linux kernel:

- version 4.9.30

 

My computer specification:

 

Quote

GPUs: (x2) Gigabyte GeForce GTX 970 Gaming G1 WindForce OC 4GB GDDR5

RAM: (x2) DDR4 3000 PC4-24000 8GB

CPU: Intel Core I7-7700K 4.2GHz

MotherBoard: MSI Z270 Krait Gaming
PSU: Tacens Mars Gaming Vulcano 750W 80 Plus Silver
SSD: (x2) Samsung 850 EVO 250GB used in array as disk

Monitors: (x2) LG 22M47VQ-P

 

I have created the Ubuntu with the template. Because it is not working I have tried changing the configuration to I440fx (it was in Q35), using OVMF, etc... I put exactly like my Windows too (same CPUs, same GPU, same machine...) but it is not working neither.

 

For other hand, I had got my two GPUs together in the same IOMMU GROUP so I had to enable the ACS override to separate them. It is working perfectly with both Windows (each GPU works at the same time in different VM).

Could somebody help me?
Thank you very much!
Kind regards.

EDIT: I have solved the problem, see my last comment.

Link to comment

My Ubuntu XML:

 

<domain type='kvm'>
  <name>Ubuntu</name>
  <uuid>03b87f8a-022b-8431-317a-beadadb2a3fb</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Ubuntu" icon="ubuntu.png" os="ubuntu"/>
  </metadata>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-q35-2.7'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/03b87f8a-022b-8431-317a-beadadb2a3fb_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='2'/>
  </cpu>
  <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/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Ubuntu/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/ubuntu-16.04.3-desktop-amd64.iso'/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <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='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:f4:64:04'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc534'/>
      </source>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Link to comment

I have solved the problem.

 

The problem is not with the GPU Passthrough. Really is with the default driver of Ubuntu.

 

To solve the problem I had to install the NVIDIA driver via VNC. So I am going to put step-by-step if it is helpfully:

 

UPDATED:

 

Really you just need to install nvidia-384 packet via apt-get. After you can reboot with the GPU attached and now it will be working.

 

OLD:

1) First create the VM Ubuntu with the VNC as the main graphic device and your GPU as secondary.

2) Install Ubuntu via VNC.

3) Access to Ubuntu and download the NVIDIA drivers.

4) Before Install NVIDIA drivers, you need to disable the NOUVEAU driver which is causing the error. 
4.1) For disable, create the file:

sudo nano /etc/modprobe.d/blacklist-nouveau.conf

4.2) Add the lines:

blacklist nouveau
options nouveau modeset=0

4.3) Install dkms and regenerate the kernel initramfs:

sudo update-initramfs -u

4.4) Reboot.

5) Install NVIDIA drivers.

5.1) For install you need to be without X mode so access to another terminal with CTRL+ALT+F1.

5.2) Stop the lightdm service.

5.3) Enter to runlevel 3:

sudo init 3

5.4) Install executing the NVIDIA installer.

5.5) Shutdown the VM.

6) Now you can remove the secondary GPU and put it as the main.

 

All is working now :). Thanks to anybody.

P.D: If you have demonic audio with NVIDIA AUDIO on Ubuntu enable MSI of intel:

 

options snd-hda-intel enable_msi=1


Regards,

Pedro.

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...