joeknock90 / Single-GPU-Passthrough

1.48k stars 75 forks source link

AMD GPUs and non systemd distros support? #84

Open EsmailELBoBDev2 opened 2 years ago

EsmailELBoBDev2 commented 2 years ago

As an RX 570 user and As Artix linux (runit) user

I really want script is more not dependent on systemd so is there a way to update script to work with all? and I tried to find something for amd but found nothing

NullR3ference commented 2 years ago

I think the following lines: systemctl start display-manager.service and systemctl stop display-manager.service in files: example-revert.sh and example-start.sh can be replaced with other init to start display manager what u need.

What about AMD GPUs: the following lines: modprobe nvidia modprobe nvidia_modeset modprobe nvidia_uvm modprobe nvidia_drm is target ONLY to load NVIDIA proprietary drivers after the guest VM is shutting down I don`t know, how to load AMD drivers

Fr3akyMurk commented 8 months ago

@joeknock90 Bump. Need info if we can get a possibility of this.

tlg-tg commented 4 months ago

Hello I have found out that for me it works with these configurations

qemu.d/win10/prepare/begin/start.sh

!/bin/bash

set -x

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

echo 0 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind

sleep 2

virsh nodedev-deatach $VIRSH_GPU_VIDEO virsh nodedev-deatach $VIRSH_GPU_AUDIO

modprobe vfio modprobe vfio_pci modprobe vfio_iommu_type1

and here is the /release/end/revert.sh

set x

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

modprobe -r vfio_pci modprobe -r vfio_iommu_type1 modprobe -r vfio

virsh nodedev-reattach $VIRSH_GPU_VIDEO virsh nodedev-reattach $VIRSH_GPU_AUDIO

echo 1 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind

modprobe amdgpu

Hope this helps some people.