From: Christian Heller Date: Wed, 29 Mar 2017 00:35:46 +0000 (+0200) Subject: Provide scripting for W530 to startx with forced NVidia GPU usage. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7Bprefix%7D%7D/bar%20baz.html?a=commitdiff_plain;h=8cb8b27b86315b95fac04800be36ce78f8aead97;p=config Provide scripting for W530 to startx with forced NVidia GPU usage. --- diff --git a/dotfiles/user/thinkpad/W530/startx_force_nvidia.sh b/dotfiles/user/thinkpad/W530/startx_force_nvidia.sh new file mode 100755 index 0000000..babdbff --- /dev/null +++ b/dotfiles/user/thinkpad/W530/startx_force_nvidia.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Undo bumblebee setup. +sudo service bumblebeed stop +sudo modprobe nvidia-drm +sudo update-alternatives --set glx /usr/lib/nvidia + +# Use special xorg.conf and pass NVIDIA_DIRECT directive to .xinitrc. +NVIDIA_DIRECT=1 startx -- -config xorg.conf.alt + +# Recreate bumblebee setup. +sudo service bumblebeed start +sudo update-alternatives --auto glx diff --git a/dotfiles/user/thinkpad/minimal/xinitrc b/dotfiles/user/thinkpad/minimal/xinitrc index 0305723..29de637 100644 --- a/dotfiles/user/thinkpad/minimal/xinitrc +++ b/dotfiles/user/thinkpad/minimal/xinitrc @@ -16,5 +16,14 @@ setxkbmap de # Set up compose key. xmodmap ~/.Xmodmap +# Optionally, for certain Optimus systems with a first GPU connected to the +# display and a second (NVidia) GPU providing 3D acceleration, use the first GPU +# as sink for the second. This may confuse DPI settings, so re-set those. +if [ "${NVIDIA_DIRECT}" ]; then + xrandr --setprovideroutputsource modesetting NVIDIA-0 + xrandr --auto + xrandr --dpi 96 +fi + # Launch window manager. i3 -c ~/.i3