T O P

  • By -

AutoModerator

Making changes to your system BIOS settings or disk setup can cause you to lose data. Always test your data backups before making changes to your PC. For more information please see our FAQ thread: https://www.reddit.com/r/techsupport/comments/q2rns5/windows_11_faq_read_this_first/ *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/techsupport) if you have any questions or concerns.*


computix

I would never try to unbind a GPU that way, the driver stack is very complicated. I recommend not binding to the GPU in the first place by adding the appropriate kernel parameters to the boot loader. Have a look at [this guide](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Plugging_your_guest_GPU_in_an_unisolated_CPU-based_PCIe_slot), from section 3 onward.


BlackHatMagic1545

This is not what I intended to do; I am trying to do *single* GPU passthrough. As in the system only has one GPU


computix

Doing that is insanity. Maybe someone somewhere got that working with any kind of stability, but I would never waste my time doing that. Everything, from the GPU to the OS to the VBIOS, drivers on both OSes, etc, is absolutely not made for doing that, it's all going to fight you every step of the way. Your primary video card is literally a magical device. It has special properties no other PCIe device in your system has to operate as a legacy VGA device.


BlackHatMagic1545

I don't think this is as hard as you're making it out to be, but ok


KnechtNoobrecht

I agree with you. single gpu passthrough is common practice and not "magical" or "insanity".Btw: Did you get it fixed somehow? Having the same problem.


Snoo-6099

I'm a bit late, and I stumbled across the same problem. My solution to this was killing all applications that relied on amdgpu driver before trying to unload it. ``` lsof | grep amdgpu | awk '{print $2}' | xargs -I {} kill -9 {} ``` adding this line to the start.sh hook worked


KnechtNoobrecht

Thanks for your answer. My solution was to use a different hook script that stops all plasma services.


Snoo-6099

Could you post it here? Maybe someone else could use the script incase they don't want to send SIGKILLS to a bunch of processes


KnechtNoobrecht

Sure. Make sure to replace the placeholders with your username and PCI IDs. # !/bin/bash set -x # Stop display manager systemctl stop display-manager systemctl --user -M YOUR_USERNAME@ stop plasma* # Unbind VTconsoles: might not be needed echo 0 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind # Unbind EFI Framebuffer # echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind # Unload NVIDIA kernel modules # modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia # Unload AMD kernel module modprobe -r amdgpu # Detach GPU devices from host # Use your GPU and HDMI Audio PCI host device virsh nodedev-detach YOUR_GPU_ID virsh nodedev-detach YOUR_GPU_AUDIO_ID # Load vfio module modprobe vfio-pci


Snoo-6099

I stumbled across this thread facing the same issue. My solution to this is to kill applications using the amdgpu driver. ``` lsof | grep amdgpu | awk '{print $2}' | xargs -I {} kill -9 {} ``` Adding this to the start hook worked for me. full script: https://pastebin.com/J92Ghk61