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.

28 lines
697 B
Plaintext

#!/bin/bash
4 years ago
function exit_script() {
echo 1 | sudo tee /sys/bus/pci/devices/0000:01:00.0/remove
echo 1 | sudo tee /sys/bus/pci/devices/0000:01:00.1/remove
echo 1 | sudo tee /sys/bus/pci/devices/0000:01:00.2/remove
echo 1 | sudo tee /sys/bus/pci/devices/0000:01:00.3/remove
}
trap exit_script SIGINT
trap exit_script SIGTERM
4 years ago
if lspci | grep -i nvidia; then
vblank_mode=0 primusrun "$@"
else
4 years ago
echo 1 | sudo tee /sys/bus/pci/rescan
sudo modprobe nvidia
sleep 1
vblank_mode=0 primusrun "$@"
fi
exit_script
#sleep 1
#if nvidia-smi | grep "No running processes found"; then
# sudo rmmod nvidia_modeset
# sudo rmmod nvidia
# sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
#fi