Skip to content

Instantly share code, notes, and snippets.

@Bomberus
Created October 12, 2016 08:14
Show Gist options
  • Save Bomberus/6059c4281ecce01af91e2f0f69b6aa1d to your computer and use it in GitHub Desktop.
Save Bomberus/6059c4281ecce01af91e2f0f69b6aa1d to your computer and use it in GitHub Desktop.
GPU Switcher NVIDIA <--> Nouveau <--> VFIO-PCI
#!/bin/sh
# Switch GPU Drivers
# Script by Pascal Maximilian Bremer
# === Functions ===
# Read GPUs in System
lspci -v | perl -ne '/VGA/../^$/ and /VGA|Kern/ and print'
# Read name of selected GPU
# Switch GPU
# Detect XServer
# Shutdown XServer
# Start XServer
lspci -v -s 01:00.0 | grep "Kernel driver in use:" | awk -F ": " '{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment