dotfiles/scripts/cudarun

13 lines
309 B
Plaintext
Raw Normal View History

2017-11-26 08:53:39 +01:00
#!/usr/bin/env bash
if [ -z $DISPLAY ]
then
sudo tee /proc/acpi/bbswitch <<< ON
"$@"
rmmod nvidia_uvm
rmmod nvidia
sudo tee /proc/acpi/bbswitch <<< OFF
else
PATH="/opt/cuda/bin:$PATH" LD_LIBRARY_PATH="/opt/cuda/lib64:$LD_LIBRARY_PATH" VBLANK=0 VGL_READBACK=pbo optirun -c yuv "$@"
fi