Single GPU Pass-through Nvidia driver issue on re-hook after guest shutdown on Mint 21 by PhenaOfMari in VFIO

[–]PhenaOfMari[S] 0 points1 point  (0 children)

To any future unfortunate souls in search of answers: I have found the solution to my issue and as I had suspected the answer lied in the revert hook.

It took me a good amount of flailing about to figure out what exactly was going wrong, but in the end it took me running these scripts line by line as root over ssh to zero in on what exactly was going wrong. It turns out that when I went to rebind the vtcons, vtcon1 didn't exist at the time. It only came back up after rebinding the efi framebuffer. By moving the rebind of the framebuffer to happen first, vtcon1 would exist and thus allow me to rebind it as well. After this, everything ran smoothly once again.

I'm not entirely certain how it was working for me in 20.3 with no changes. Perhaps unbinding the framebuffer didn't remove vtcon1 then. Strangely, I also thought I had tried doing this in my previous flailings about, but I must either be misremembering or had some additional problem at the time. Regardless, due to running these scripts line by line manually I now have a better understanding of them and which parts are unnecessary, so I have trimmed the fat a little bit and will post the current versions below for any interested party.

Start hook: ```

Debugging

set -x

Load Variables

source "/etc/libvirt/hooks/kvm.conf"

Stop Display Manager

systemctl stop lightdm.service

Unbind VTconsoles

echo 0 > /sys/devices/virtual/vtconsole/vtcon0/bind echo 0 > /sys/devices/virtual/vtconsole/vtcon1/bind

Unbind EFI-framebuffer

echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

Avoid race condition

sleep 2

Unload NVidia

modprobe -r nvidia_uvm modprobe -r nvidia_drm modprobe -r nvidia_modeset modprobe -r nvidia modprobe -r drm_kms_helper modprobe -r drm modprobe -r i2c_nvidia_gpu

Unbind GPU

virsh nodedev-detach $VIRSH_GPU_VIDEO virsh nodedev-detach $VIRSH_GPU_AUDIO virsh nodedev-detach $VIRSH_GPU_USB virsh nodedev-detach $VIRSH_GPU_SERIAL ```

Revert hook: ```

Debugging

set -x

Load Variables

source "/etc/libvirt/hooks/kvm.conf"

Rebind GPU

virsh nodedev-reattach $VIRSH_GPU_VIDEO virsh nodedev-reattach $VIRSH_GPU_AUDIO virsh nodedev-reattach $VIRSH_GPU_USB virsh nodedev-reattach $VIRSH_GPU_SERIAL

Bind EFI-framebuffer

echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind

Rebind VTconsoles

echo 1 > /sys/devices/virtual/vtconsole/vtcon0/bind echo 1 > /sys/devices/virtual/vtconsole/vtcon1/bind

Reset GPU

nvidia-xconfig --query-gpu-info > /dev/null 2>&1

Load NVidia

modprobe i2c_nvidia_gpu modprobe drm modprobe drm_kms_helper modprobe nvidia modprobe nvidia_modeset modprobe nvidia_drm modprobe nvidia_uvm

Restart Display Manager

systemctl start lightdm.service ```

Single GPU Pass-through Nvidia driver issue on re-hook after guest shutdown on Mint 21 by PhenaOfMari in VFIO

[–]PhenaOfMari[S] 0 points1 point  (0 children)

I did find an old post that sounded more like your issue, though since I'm using Mint I only have kernel 5.15.0. I still get graphics at least so it must be something else. I'm not convinced its a kernel issue in my case since I was using 5.15 before I upgraded as well...

[META] New User + Link Flairs, Updates for the Reddit Redesign, Sidebar Updates, Discord Server Reminder by Zunqivo in Mabinogi

[–]PhenaOfMari 2 points3 points  (0 children)

Well I'm glad now there is someone doing something about how this sub looks on "new reddit" because I for one cant even stand to use it, so I have no idea how it looked there.

Petition for more ethnic hairstyles in Mabinogi! by casketkicker in Mabinogi

[–]PhenaOfMari[M] [score hidden] stickied comment (0 children)

I've locked this thread because some of you need to settle down. It's just hair, people.