joeknock90 / Single-GPU-Passthrough

1.48k stars 75 forks source link

virsh nodedev-reattach causes kernel oops #93

Closed notmentaloutlaw closed 1 year ago

notmentaloutlaw commented 1 year ago

Hello I am trying to return the graphics card from guest to host. However, it triggers kernel oops. I was wondering if you can help me solve this. I am on kernel 6.0.10.

This is my start.sh

#!/bin/sh
set -x
kill -9 $(pidof dwl)
virsh nodedev-detach pci_0000_03_00_0
virsh nodedev-detach pci_0000_03_00_1

This is my end.sh

#!/bin/sh
set -x
virsh nodedev-reattach pci_0000_03_00_0
virsh nodedev-reattach pci_0000_03_00_1

The start.sh does not include the vtconsoles/framebuffer or the unloading and loading the modules. This is because I believe for my system the virsh commands does this by itself and I don't need to do anything. However, if I try to do anything in the end.sh it triggers kernel oops. I would like some assistance with this

notmentaloutlaw commented 1 year ago

The solution to this issue is to add the following lines before the virsh nodedev-reattach commands:

virsh nodedev-reset pci_0000_03_00_0
virsh nodedev-reset pci_0000_03_00_1

Hope this helps anyone searching for a solution.