# GPU Fan speed control in Ubutu Server without "nvidia-setting"

**URL:** <https://forums.developer.nvidia.com/t/gpu-fan-speed-control-in-ubutu-server-without-nvidia-setting/273879>\
**Category:** Linux\
**Created:** [November 24, 2023, 4:02am UTC](https://forums.developer.nvidia.com/t/gpu-fan-speed-control-in-ubutu-server-without-nvidia-setting/273879 "2023-11-24T04:02:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebkarimi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ebkarimi](https://forums.developer.nvidia.com/u/ebkarimi)\
**Post date:** [November 24, 2023, 4:02am UTC](https://forums.developer.nvidia.com/t/gpu-fan-speed-control-in-ubutu-server-without-nvidia-setting/273879/1 "2023-11-24T04:02:46Z")

</div>

Hi,

I have RTX 2080 TI GPUs on my Server (OS: Ubuntu 20.04 Sever version). I cannot install “Nvidia-settings” because my OS doesn’t suppurt GUI. My goal is to control GPU FAN Speed using “nvidia-smi” command or any app that you recommend. The GPUs are running hot because I cannot raise the fan speed (RPM). I can however limit the power to 170 using “sudo nvidia-smi -pl 170” command, but still the GPU are hot because the fan speed is on 35% and I cannot change that. Is there any command or app that I can use to control the fan speed. Again, installing “nvidia-settings” is not an option for my Ubuntu Server OS.

---

<div class="post-metadata">

**Author:** ![generix](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/generix/32/16024_2.png) [@generix](https://forums.developer.nvidia.com/u/generix)\
**Post date:** [November 24, 2023, 10:18am UTC](https://forums.developer.nvidia.com/t/gpu-fan-speed-control-in-ubutu-server-without-nvidia-setting/273879/2 "2023-11-24T10:18:47Z")

</div>

Short answer: no  
Fan speed is set through the NVCTRL X extension, obviously needing an Xserver running (as root).  
Since you’re running headless, please make sure nvidia-persistenced is running.

---

<div class="post-metadata">

**Author:** ![kristoffer.deinoff](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kristoffer.deinoff/32/285297_2.png) [@kristoffer.deinoff](https://forums.developer.nvidia.com/u/kristoffer.deinoff)\
**Post date:** [October 19, 2024, 8:39pm UTC](https://forums.developer.nvidia.com/t/gpu-fan-speed-control-in-ubutu-server-without-nvidia-setting/273879/3 "2024-10-19T20:39:17Z")

</div>

I don’t remember where I found this script, but it prevents my old mining rig with 11x GeForce 1060 6GB + 2x TESLA P40 from melting when finetuning AI models.  
`./fan-control.sh 100` - Sets all fans to full speed

`fan-control.sh`

```shell
#!/bin/bash

# Desired fan speed (as a percentage, e.g., 60 for 60%)
FAN_SPEED=$1

# Enable manual fan control
sudo nvidia-smi -pm 1 # Enables persistence mode
sudo nvidia-settings -a "[gpu:0]/GPUFanControlState=1"

# Get the number of GPUs
NUM_GPUS=$(nvidia-smi -L | wc -l)

# Set the fan speed for each GPU
for (( GPU_ID=0; GPU_ID<NUM_GPUS; GPU_ID++ ))
do
    sudo nvidia-settings -c gpu -a "[fan:$GPU_ID]/GPUTargetFanSpeed=$FAN_SPEED"
done

echo "Fan speed set to $FAN_SPEED% for all $NUM_GPUS GPUs."

```
