Skip to content

Instantly share code, notes, and snippets.

@talmo
Created February 11, 2026 04:43
Show Gist options
  • Select an option

  • Save talmo/b592fb5372630ea823935ec7a047ab26 to your computer and use it in GitHub Desktop.

Select an option

Save talmo/b592fb5372630ea823935ec7a047ab26 to your computer and use it in GitHub Desktop.
Install btop from source with NVIDIA GPU support (Ubuntu 24.04)
#!/usr/bin/env bash
set -euo pipefail
# Remove existing btop installs
if [ -f /usr/local/bin/btop ]; then
echo "Removing old btop at /usr/local/bin/btop..."
rm /usr/local/bin/btop
fi
if snap list btop &>/dev/null; then
echo "Removing snap btop..."
snap remove btop
fi
# Build btop from source with GPU support (dynamic linking required for NVIDIA)
# No apt calls — g++-14 and libdrm-dev are already installed
BTOP_BUILD_DIR=$(mktemp -d)
git clone --depth 1 https://github.com/aristocratos/btop.git "$BTOP_BUILD_DIR"
cd "$BTOP_BUILD_DIR"
make CXX=g++-14 GPU_SUPPORT=true -j"$(nproc)"
make install PREFIX=/usr/local
# Clean up
rm -rf "$BTOP_BUILD_DIR"
echo ""
echo "Done! btop installed to /usr/local/bin/btop with GPU support."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment