Skip to content

Instantly share code, notes, and snippets.

@sunsided
Created July 29, 2021 13:53
Show Gist options
  • Save sunsided/a89d2aa658e14696bc73b4671991d5aa to your computer and use it in GitHub Desktop.
Save sunsided/a89d2aa658e14696bc73b4671991d5aa to your computer and use it in GitHub Desktop.
GPU selection
#!/usr/bin/env bash
set -eo pipefail
# Options: nvidia, intel, query
GPU=${1:-query}
echo "Current renderer:"
glxinfo | grep -E "OpenGL renderer\ string"
echo ""
echo "Selecting '$GPU' GPU."
sudo prime-select $GPU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment