Skip to content

Instantly share code, notes, and snippets.

@Drewlius
Created August 1, 2026 15:13
Show Gist options
  • Select an option

  • Save Drewlius/3626783522a155c86b45a13a3aa3586d to your computer and use it in GitHub Desktop.

Select an option

Save Drewlius/3626783522a155c86b45a13a3aa3586d to your computer and use it in GitHub Desktop.
NVIDIA-SMI interact-able to adjust GPU power limit on the fly
#!/bin/bash
printf "Set Temporary NVIDIA GPU Power Limit\n"
read -p "Enter wattage (RTX 5090 range: 400-600): " WATTS
if sudo nvidia-smi -pl "$WATTS"; then
printf "GPU power limit set to %s W.\n" "$WATTS"
else
printf "Error: NVIDIA rejected the requested power limit.\n"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment