How to Set NVIDIA GPU Power Limit on Ubuntu using nvidia-smi

How to Set NVIDIA GPU Power Limit on Ubuntu using nvidia-smi

Managing the power consumption of your NVIDIA GPU on Ubuntu is a practical way to optimize energy efficiency, especially for workloads that do not require full GPU performance. This guide explains how to check and set power limits for your NVIDIA GPU and how to make those settings persistent across reboots.



Requirements

ComponentDescription
OSUbuntu or compatible Linux distribution
ToolsNVIDIA proprietary drivers, nvidia-smi utility
AccessTerminal access, sudo/root privileges


1. Check Current Power Limits

To see current power usage and limits:
  1. $ nvidia-smi -q -d POWER

This command shows:

  • Current Power Limit

  • Default Power Limit

  • Minimum and Maximum Power Limits

📝 Note: Always choose a value within the allowed min/max limits.

2. Set a New Power Limit

To apply a new power cap (e.g., 200W):

  1. $ sudo nvidia-smi -pl 200

 You must have root privileges to change power settings.


3. Confirm the New Settings

Verify the change with:

  1. $ nvidia-smi -q -d POWER

Ensure that the Current Power Limit now reflects your desired value.


4. Make the Power Limit Persistent (Optional)

Power limit changes do not persist after a reboot by default. To make it permanent:
Step 4.1: Create a systemd service

  1. $ sudo nano /etc/systemd/system/nvidia-power-limit.service

Paste the following content:


  1. [Unit]
  2. Description=Set NVIDIA GPU Power Limit
  3. After=multi-user.target
  4. [Service]
  5. Type=oneshot
  6. ExecStart=/usr/bin/nvidia-smi -pl 200
  7. [Install]
  8. WantedBy=multi-user.target

Step 4.2: Enable the service


  1. $ sudo systemctl enable nvidia-power-limit.service

The service will now run on each boot and apply your configured power limit.

You can modify ExecStart to set different limits or apply settings to specific GPU IDs using nvidia-smi -i <GPU_ID> -pl <WATTS>.