From 6df86b512f5352fb27d576fb5830a20ec541d8c6 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Sat, 8 Aug 2020 11:58:05 -0500 Subject: [PATCH] Add bumblebee script --- etc/bumblebee/bumblebee.conf | 4 ++-- gpuapp | 28 ++++++++++++++++++++++++++++ gpuoff.sh | 4 ++-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100755 gpuapp diff --git a/etc/bumblebee/bumblebee.conf b/etc/bumblebee/bumblebee.conf index dc8b02e..a625842 100644 --- a/etc/bumblebee/bumblebee.conf +++ b/etc/bumblebee/bumblebee.conf @@ -7,7 +7,7 @@ VirtualDisplay=:8 # Should the unused Xorg server be kept running? Set this to true if waiting # for X to be ready is too long and don't need power management at all. -KeepUnusedXServer=true +KeepUnusedXServer=false # The name of the Bumbleblee server group name (GID name) ServerGroup=bumblebee # Card power state at exit. Set to false if the card shoud be ON when Bumblebee @@ -29,7 +29,7 @@ IGCPCIVendorId=0x1002 [optirun] # Acceleration/ rendering bridge, possible values are auto, virtualgl and # primus. -Bridge=primus +Bridge=auto # The method used for VirtualGL to transport frames between X servers. # Possible values are proxy, jpeg, rgb, xv and yuv. VGLTransport=proxy diff --git a/gpuapp b/gpuapp new file mode 100755 index 0000000..4a526a6 --- /dev/null +++ b/gpuapp @@ -0,0 +1,28 @@ +#!/bin/bash +function exit_script { + sleep 0.5 + 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 +} + +trap exit_script SIGINT +trap exit_script SIGTERM +if lsmod | grep nvidia; then + vblank_mode=0 primusrun "$@" +else + sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._ON" > /proc/acpi/call' + 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 + + diff --git a/gpuoff.sh b/gpuoff.sh index 5ebfd59..902a17b 100755 --- a/gpuoff.sh +++ b/gpuoff.sh @@ -1,7 +1,7 @@ #!/bin/bash #sudo rmmod nvidia_drm -#sudo rmmod nvidia_modeset -#sudo rmmod nvidia +sudo rmmod nvidia_modeset +sudo rmmod nvidia #sudo tee /proc/acpi/bbswitch << /sys/bus/pci/devices/0000:01:00.0/remove; echo '\\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call"