VFIO hook script is not working, will restart but never bring up my windows OS (seems to get caught somewhere)

hey all I have a weird issue, i am using virt-manager and trying to make VFIO work to passthrough my gpu to my windows 11. I am on an AMD Ryzen 7 3700x and a AMD RX 6700, my hook script seems to mess up, I expect it to rest for 10 second then there is no errors, but I think I did it wrong, i followed SomeordinaryGamers single gpu video, and tried to adjust for my AMD graphics card, I have not installed any extra drivers, but I feel like I am doing it wrong, this script was in ubuntu and seemed to sleep but also failed to run the hook, here is my current script

#debugging
set -x

#load variables we defined
source "/etc/libvirt/hooks/kvm.conf"

#stop display manager
systemctl stop display-manager.service

## Uncomment the following line if you use GDM
killall gdm-x-session

# unbind VTconsoles
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

# avoid race condition
sleep 10

# unload amdGPU
modprobe -r amddrm_ttm_helper
modprobe -r amdttm
modprobe -r amdxcp
modprobe -r iommu_v2
modprobe -r amddrm_buddy
modprobe -r amd_sched
modprobe -r amdkcl
modprobe -r i2c_algo_bit
modprobe -r drm_display_helper
modprobe -r drm_kms_helper
modprobe -r drm
modprobe -r video

#unbind gpu
virsh nodedev-detach $VIRTSH_GPU_VIDEO
virsh nodedev-detach $VIRTSH_GPU_AUDIO

#load vfio

modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1

I’m gonna preface this by saying I dont use Gnome, GDM, or have much familiarity with your actual goals here …

this doesnt need quotes … but did you create that file?

I’m guessing this should be your actual display manager … GDM ?

I guess you do use GDM? Also … I would suppose this depends on whether you are using X or wayland.

This section interestingly does not include unloading the amdgpu module.

my apologizes, I am in my manjaro now, I have conversed a little with chatgpt, (if this is correct) I have lsmod | grep amd to find amdgpu then i did modinfo amdgpu | grep depends to remove its dependencies I had accidentally posted the wrong script, my main goal is to pass my single gpu to my windows VM so I can game then when I am done gaming I can turn it off and be in manjaro again.
yes I added /etc/libvirt/hooks/kvm.conf
kvm.conf:

VIRSH_GPU_VIDEO=pci_0000_28_00_0
VIRSH_GPU_AUDIO=pci_0000_28_00_1

this is from my search in IOMMU groups,
it SHOULD point to here
“IOMMU Group 18:
28:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 33 [Radeon RX 7700S/7600/7600S/7600M XT/PRO W7600] [1002:7480] (rev cf)
IOMMU Group 19:
28:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 HDMI/DP Audio [1002:ab30]”

I’m not really sure why my video driver and audio are not in the same group but as far as I know (well given I gave the wrong code, my knowledge is very limited) if they are the only thing in the group that is okay as long as there is no other things in the group

my corrected code is

#debugging
set -x

#load variables we defined
source /etc/libvirt/hooks/kvm.conf

#stop display manager
systemctl stop sddm.service

# unbind VTconsoles
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

# avoid race condition
sleep 10

# unload amdGPU
modprobe -r amdgpu
modprobe -r drm_display_helper
modprobe -r ttm
modprobe -r drm_buddy
modprobe -r gpu-sched
modprobe -r amdxcp
modprobe -r drm_suballoc_helper
modprobe -r video
modprobe -r drm_ttm_helper
modprobe -r i2c-algo-bit

#unbind gpu
virsh nodedev-detach $VIRTSH_GPU_VIDEO
virsh nodedev-detach $VIRTSH_GPU_AUDIO

#load vfio
modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1

again my apologize

if there is a better solution to game from my windows drive (I have tested the vm with virt-manager’s basic setup but it is really slow, linux is not my main platform I know some linux commands but admittedly this is a little bit out of my wheelhouse, I mainly have linux to use rocm and gets better speeds in AI generation.