Skip to content

Instantly share code, notes, and snippets.

@giraphics
Created June 28, 2025 08:04
Show Gist options
  • Save giraphics/9cf889f71cfc795a295966cf0cb0843d to your computer and use it in GitHub Desktop.
Save giraphics/9cf889f71cfc795a295966cf0cb0843d to your computer and use it in GitHub Desktop.
OpenGL WSL Setup
#!/bin/bash
echo "πŸ” Checking Wayland Display:"
echo "$WAYLAND_DISPLAY"
echo "πŸ”§ Checking NVIDIA GPU status (optional):"
nvidia-smi || echo "NVIDIA not detected or not available in WSL"
echo "πŸ”„ Updating APT packages..."
sudo apt update
echo "πŸ“¦ Installing OpenGL test utilities..."
sudo apt install -y mesa-utils
echo "▢️ Testing OpenGL with glxgears (this will open a test window)..."
glxgears & sleep 5 && kill $!
echo "🧰 Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "🍺 Verifying brew installation:"
brew --version
echo "πŸ“¦ Installing CMake via brew..."
brew install cmake
echo "πŸ”§ Installing build tools..."
sudo apt install -y build-essential pkg-config
echo "πŸ“¦ Installing OpenGL-related dev libraries..."
sudo apt install -y libgl1-mesa-dev libglx-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment