Ubuntu 中 Nvidia GPU 直通失败

Ubuntu 中 Nvidia GPU 直通失败

我跟着这个帖子设置直通。我还参考了一些其他文章。我按照以下方法安装了驱动程序本文

对于 qemu 2.2,我尝试了以下两个选项:

-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \                
-device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 \
-M q35

-device vfio-pci,host=02:00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=02:00.1 \
-vga none

当我lspci -vv在客人上运行:

01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 760] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Device 196e:0984
    Physical Slot: 0
    Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 10
    Region 0: Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
    Region 1: Memory at e8000000 (64-bit, prefetchable) [size=128M]
    Region 3: Memory at f0000000 (64-bit, prefetchable) [size=32M]
    Region 5: I/O ports at c000 [size=128]
    Expansion ROM at fd000000 [disabled] [size=512K]
    Capabilities: <access denied>

01:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
    Subsystem: Device 196e:0984
    Physical Slot: 0
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 256 bytes
    Interrupt: pin B routed to IRQ 17
    Region 0: Memory at fd080000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: snd_hda_intel

当我运行 smi 时:

$ nvidia-smi 
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

在主机上:

02:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 760] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Device 196e:0984
    Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 16
    Region 0: Memory at f9000000 (32-bit, non-prefetchable) [size=16M]
    Region 1: Memory at d8000000 (64-bit, prefetchable) [size=128M]
    Region 3: Memory at d6000000 (64-bit, prefetchable) [size=32M]
    Region 5: I/O ports at cc00 [size=128]
    Expansion ROM at f8f80000 [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: vfio-pci

02:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
    Subsystem: Device 196e:0984
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 256 bytes
    Interrupt: pin B routed to IRQ 17
    Region 0: Memory at f8f7c000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: vfio-pci

我尝试了好几天都没找到答案,重新绑定了 GPU,重新安装了驱动程序等等。但我仍然不知道哪一步出了问题。

我是否成功通过了 GPU?如何才能让它在客户机上运行?

任何帮助都将非常有帮助。提前致谢。

相关内容