Reducing the Power Usage on Unraid servers With Nvidia GPUs

Reducing the Power Usage on Unraid servers With Nvidia GPUs

Spaceinvader One

2 года назад

31,421 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Jayphen
Jayphen - 13.08.2023 14:57

Thanks for pointing in the right direction!

I have a 3080ti that I only really use for my gaming VM. I used a tplink energy monitor and was shocked to see that my machine was using ~180W at idle with no VM running.

I discovered that if you simply run nvidia-persistenced, it will put the gpu in to the power saving mode. The script you've shared does look more robust though.

I ended up adding a hook in /etc/libvirt/hooks/gpu_toggle and chmod +x that `gpu_toggle` file. This is the contents of my hook:

```
#!/bin/bash

if [[ $2 == "prepare" ]]
then
echo "starting vm"
kill -9 `pidof nvidia-persistenced`
docker container stop Plex-Media-Server
docker container start Plex-Media-ServerNO-GPU
fi
if [[ $2 == "release" ]]
then
echo "killing vm"
nvidia-persistenced
docker container stop Plex-Media-ServerNO-GPU
docker container start Plex-Media-Server
fi
```

This is a pretty rough script, but basically when a VM starts I kill persistenced, stop the Plex container that uses the GPU for transcoding and start one that does not use it.

When the VM stops (releases), I start persistenced and the container that uses the gpu.

I haven't passed through my GPU obviously, but it is still working well with my VM. With this config, I can get the most out of it while saving a lot of energy. The machine now runs at 80W at idle when the VM is not running.

Ответить
Chance Neel
Chance Neel - 12.08.2023 19:41

This doesn't appear to be doing anything for my RTX 4060. Still shows an idle power draw of 55 watts.

Ответить
craig still
craig still - 10.08.2023 00:52

i wish i watched this fully year ago , from 50watt idil to 8watt

Ответить
Vincenzo Giusto
Vincenzo Giusto - 04.08.2023 09:32

Will this also work for a GPU that has been assigned to a VM?

Ответить
Mert Özkan
Mert Özkan - 19.07.2023 11:39

I guess we can't use this for passthrough gpus or devices assigned to a vm

Ответить
Chris Holzer
Chris Holzer - 30.06.2023 12:37

why cant unraid do that on its own? or is it the drivers fault?

Ответить
Zeke
Zeke - 03.05.2023 17:53

My GTX 1080 was showing 19W, yet my NUT UPS display was showing I was pulling 125W total. After running the script I saw the power state dropped from P5 to P8, and instead of 19W it was pulling 12W. The overall UPS power draw now showed 72W. Thanks... I'll keep that 53W power savings.

Ответить
MelkusS 78
MelkusS 78 - 26.04.2023 14:13

Thank you very much!!!

Ответить
kazolar
kazolar - 06.03.2023 19:44

wow dropped my 3060ti from 47 to 24. Awesome

Ответить
Tom Foolery
Tom Foolery - 12.12.2022 17:59

What does it do if the GPU is in use when the script runs? Does it just ignore the script and keep working on whatever task it's been assigned?

Ответить
RobotBlut
RobotBlut - 30.10.2022 02:33

THANKS 3080

Ответить
Wes Crockett
Wes Crockett - 27.10.2022 06:29

HUGE! Thanks!

Ответить
R S
R S - 18.10.2022 20:23

thanks! you are the best.

Ответить
polarzombies
polarzombies - 04.10.2022 23:21

Got my GPU's idle powerdraw to drop from like 90w to 7W

Ответить
Pedro Villalobos
Pedro Villalobos - 28.09.2022 22:10

Commenting it here as I basically reset my whole VMs for not knowing what the issue was and I was only able to get it back to working properly once I had removed the NVidia drivers from Unraid:

You CAN have NVidia drivers installed on Unraid, just know that when you connect to a Windows VM (Windows 11 Pro with Parsec or RDP on my case), you might see a black screen that won't go away.

It's not the same black screen as when you are trying to boot without GPU's bios. I just disconnect and reconnect to the VM (RDP or Parsec) and it all works WITH the gpu.

Ответить
ZombieSchandmaul
ZombieSchandmaul - 13.09.2022 14:05

my gpu does sadly not report power consumption and i dont see anything in Unraid to display overall power consumption. would be great if someone could help me im pretty new in unraid and even google didnt display any useful information exept for this video

Ответить
SumMarbles
SumMarbles - 01.09.2022 01:02

so if the gpu is lets say transcoding and then the hourly script hits will it just go back into a transcode power mode?

Ответить
Kim Son Vu
Kim Son Vu - 10.08.2022 22:27

Love you!

Ответить
Christopher Lantesh
Christopher Lantesh - 11.07.2022 02:13

Thank you so much for this. They only time I need my GPU in a higher power state is when it's transcoding video. Otherwise it's just at idle. So this script is great!

Ответить
Thx And Bye
Thx And Bye - 04.06.2022 23:29

Setting the persistence mode via nvidia-smi is deprecated functionality by nvidia. It still works (for now), but the correct way to persist the driver now is using nvidia-persistenced.

Ответить
dragons-58
dragons-58 - 30.05.2022 09:55

hello, I would like to make it possible to connect to the nas with folders inside even from outside the home, that is, remotely but since they removed the openvpn-as plugin I don't know how to do this anymore, can you help me please, I need detailed instructions . I immediately thank those people who will help me. It is urgent.

Ответить
Donny Ferris
Donny Ferris - 27.05.2022 17:06

Someone should do the math here… how much will we save per month (I’m guessing it’s not more than a buck or two) - and how long will it take to pay for $1000+ for a couple of Nvidia graphics cards? Even if you save $5/month (very unlikely), it would still take over 16 YEARS to pay for those video cards.

Ответить
BLKMGK4
BLKMGK4 - 18.05.2022 03:57

GTX1050 that's been unlocked, of course it doesn't show power usage but I know it's power state doesn't drop properly - thanks for the script!

Ответить
drop0ne
drop0ne - 08.05.2022 22:13

Mad love bro!!!! THANK YOU VERY MUCH MAN!!!!!

Ответить
XisoP's prints
XisoP's prints - 02.05.2022 22:52

Thanks Ed :)
Every little bit helps, this is saving me about €60 per year. Dropped from 43W to 20W on my Quaddro M4000

Ответить
Colen Casey
Colen Casey - 02.05.2022 02:37

My graphics card always shows 1 process running but card at idle
I think its taking over as the primary video even though I run the server as a headless setup
the quadro m2000 is only used for transcoding plex
is there a way to not have it selected as the primary video device

Ответить
ed theoldtechguy
ed theoldtechguy - 30.04.2022 18:35

Ed I have always enjoyed your videos and thank you greatly for your videos. Cheers!

Ответить
Philip Keeley
Philip Keeley - 26.04.2022 11:58

I didnt think i would notice muh differnce but i do they even run cooler which is great. running a Quadro p2000 and a RTX 3080 TI. temp has dropped at least 5 degrees. cheers for this.

Ответить
Tech & PC House
Tech & PC House - 25.04.2022 14:09

Thank you again! Could you make a tutorial how to run an unraid Server without any GPU / or iGPU? In my case I run a 10500f without any gpu and my old gtx 760 is still to powerhungry

Ответить
NekoKoAnime
NekoKoAnime - 23.04.2022 14:03

Went from 66-70W on the gpu to 15-15 W. very nice thx :)

Ответить
Daz
Daz - 23.04.2022 00:38

Cheers! My 970 went down from 50W to 22W. I guess the new GPUs are even more efficient.

Ответить
Tom C
Tom C - 20.04.2022 03:47

Thanks!! My 3060ti went from 54 watts at idle to 11.

Ответить
Brian
Brian - 20.04.2022 03:30

Will this cause any issues if it runs during a transcoded?

Ответить
Isaac Olsen
Isaac Olsen - 20.04.2022 00:06

Hey run this script I made without explaining what it does.....

Ответить
xweegix
xweegix - 17.04.2022 12:29

Nice timing and vid. 2nd result on a google search. 👍

Ответить
a different name
a different name - 17.04.2022 06:14

my p400 saved 8w, thanks.

Ответить
Mike Shrouder
Mike Shrouder - 16.04.2022 18:55

Could do with a scrypt for AMD

Ответить
FeistyAcorn
FeistyAcorn - 15.04.2022 05:02

This works great! Thank you!

Ответить
Troy
Troy - 15.04.2022 01:18

I learned about userscripts and the likes, but the power saving didn't work in my system. Dual Xeon x5690's so I'm hardly going to notice 20W from a GPU :( The SAS array drives consume more than the GPU. Might be time to invest in some more solar panels!

Ответить
Peter G
Peter G - 15.04.2022 00:57

Thanks so much for another awesome video keep up the wonderful work!! Cheers

Ответить
Max
Max - 15.04.2022 00:14

Great Tip!

Ответить
MeLtedLogiK
MeLtedLogiK - 14.04.2022 22:32

Hi Spaceinvader, I hope you can help because I have no idea who else to ask, when I try to use my Vive Pro 2 in a VM, I can't see the Ultra or Extreme modes for the higher resolutions. I appreciate you may not own a VP2 but I'd be so grateful if you have any ideas where I should start!? Thanks for this video, too - it will surely help once again! Many thanks in advance just for reading! :)

Ответить
Kodey Patterson
Kodey Patterson - 14.04.2022 22:00

What is SteamDeck TrueNas script?

Ответить
Alex R
Alex R - 14.04.2022 20:06

this dropped my idle on 1660ti to single digits, thanks @spaceinvader

Ответить
Johnny Woolen
Johnny Woolen - 14.04.2022 14:57

Thanks for the video! What are you using to check the system power consumption? Is that a plug-in?

Ответить
Aleksejs Hamjonoks
Aleksejs Hamjonoks - 14.04.2022 14:39

I have script just with nvidia persistance mode 1, just one row

Ответить
Darren E
Darren E - 14.04.2022 14:06

Great Vid as ever! Just need you to dig into PowerTop now ;)

Ответить
Sascha Hermann
Sascha Hermann - 14.04.2022 12:22

Even my 1050ti now needs 10W less. Thanks for your videos!!!

Ответить
John Schneider
John Schneider - 14.04.2022 12:01

This is perfect. In these times with high prices on electricity, we need all the help we can get. Spaceinvader One to the rescue :-)

Ответить