diff --git a/README.md b/README.md index 205bb0c..e47fda4 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ sudo dnf install nvidia-xrun ``` ## Troubleshooting + ### Steam issues Yes unfortunately running Steam directly with nvidia-xrun does not work well - I recommend to use some window manager like openbox. @@ -106,6 +107,10 @@ To fix, you can change the DPI settings in `~/.Xresources (~/.Xdefaults)` file b Xft.dpi: 192 ``` +### Crashing during when unloading nvidia modules + +Try set `USE_BBSWITCH=1`, you'll have to install `bbswitch` manually as well. + ### `nouveau` driver conflict `nouveau` driver should be automatically blacklisted by `nvidia` but in case it is not, `nvidia` might not get access to GPU. Then you need to manually blacklist `nouveau` following Arch wiki https://wiki.archlinux.org/index.php/kernel_modules#Blacklisting. @@ -119,4 +124,4 @@ In that case, you should add `--ignore-install` to `modprobe` calls in `nvidia-x ### Vulkan does not work Check https://wiki.archlinux.org/index.php/Vulkan * remove package vulkan-intel -* set VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json +* set VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json \ No newline at end of file diff --git a/config/nvidia-xrun b/config/nvidia-xrun index c13363e..1beb8ac 100644 --- a/config/nvidia-xrun +++ b/config/nvidia-xrun @@ -11,8 +11,16 @@ ENABLE_PM=1 # and some other programs tend to load the nvidia module if they detect a # nvidia card in the system, and when the module is loaded the card can't save # power. +# +# USE_BBSWITCH option below can override the behavior of this option. REMOVE_DEVICE=1 +# When enabled, nvidia-xrun will toggle power for the card using bbswitch. +# This *requires* bbswitch to be installed. +# +# Note that this option overrides REMOVE_DEVICE paramter above when enabled. +USE_BBSWITCH=0 + # Bus ID of the PCI express controller CONTROLLER_BUS_ID=0000:00:01.0 diff --git a/nvidia-xrun b/nvidia-xrun index 56d9855..4b78aa7 100755 --- a/nvidia-xrun +++ b/nvidia-xrun @@ -19,34 +19,44 @@ function execute { } function turn_off_gpu { - if [[ "$REMOVE_DEVICE" == '1' ]]; then - echo 'Removing Nvidia bus from the kernel' - execute "sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID}/remove <<<1" + if [[ "$USE_BBSWITCH" == '1' ]]; then + echo 'Turning off GPU using bbswitch ' + execute "sudo tee /proc/acpi/bbswitch <<<'OFF'" else - echo 'Enabling powersave for the graphic card' - execute "sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID}/power/control <<