You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
537 B
Plaintext
17 lines
537 B
Plaintext
4 years ago
|
#!/bin/bash
|
||
|
modprobe vfio-pci
|
||
|
for dev in "$@"; do
|
||
|
vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
|
||
|
device=$(cat /sys/bus/pci/devices/$dev/device)
|
||
4 years ago
|
echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
|
||
4 years ago
|
if [ -e /sys/bus/pci/devices/$dev/driver ]; then
|
||
|
#echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
|
||
|
rmmod nvidia_drm
|
||
|
rmmod nvidia_modeset
|
||
|
rmmod nvidia
|
||
|
echo "Unbound old driver"
|
||
|
fi
|
||
4 years ago
|
#echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
|
||
4 years ago
|
echo "Bound VFIO driver"
|
||
|
done
|