Reducing the Power Usage on Unraid servers With Nvidia GPUs

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 137

  • @davasseconasse
    @davasseconasse 10 місяців тому +4

    wow, went from 115w to 15w with a 3080ti, lifesaver! THANK YOU!

  • @thereallantesh
    @thereallantesh 2 роки тому +4

    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!

  • @jeppegorm6050
    @jeppegorm6050 4 місяці тому

    Tak!

  • @BSpears
    @BSpears 2 роки тому +5

    Ed, thank you! I always thought my GTX 970 was using too much power on unraid.
    Thanks again

  • @xisop
    @xisop 2 роки тому +2

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

  • @jayphen
    @jayphen Рік тому +2

    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.

    • @thymon13
      @thymon13 4 місяці тому

      Did I miss something?
      To have a gaming VM, I had to isolate my GPU to use it with passthrough. So this GPU is no longer visible to the Nvidia driver plugin.
      Is it possible to create a VM with a GPU without passthrough?

    • @jayphen
      @jayphen 4 місяці тому

      Yep, I have no problem doing it without passing through the GPU

  • @TheT8or
    @TheT8or 6 місяців тому

    Easily the best tutorials ive seen. Subscribed

  • @thisiseddy
    @thisiseddy Рік тому

    Amazing! my GTX 1060 was spinning very loud, even at idle. This made perfect!

  • @SumMarbles
    @SumMarbles 2 роки тому +4

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

  • @edtheoldtechguy
    @edtheoldtechguy 2 роки тому +1

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

  • @anthonychallis2472
    @anthonychallis2472 3 місяці тому

    Thanks for that, 24 watts down to 7watts on an Nvidia GTX1660Ti. The only thing that threw me was the much bigger script on your GitHub. I see that much of the extra is to do with the power calculator.

  • @peterg4527
    @peterg4527 2 роки тому +1

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

  • @556Bandit
    @556Bandit 2 роки тому +2

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

  • @rallygallery
    @rallygallery 2 роки тому

    Great 2 minute tip Ed! Will be installing the script.

  • @MowMdown
    @MowMdown 2 роки тому +9

    There is a much more simple script you could have used:
    #!/bin/bash
    #nvidia-smi --persistence-mode=1
    nvidia-persistenced
    fuser -v /dev/nvidia*
    and set to first start of array. nothing to run hourly.

  • @pohuliarist
    @pohuliarist 2 роки тому +11

    Thank you for the video like always. But could you please share more details about script and what it actually do with GPU???

  • @xweegix
    @xweegix 2 роки тому

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

  • @NekoKoAnime
    @NekoKoAnime 2 роки тому +1

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

  • @drop0ne_f20
    @drop0ne_f20 2 роки тому

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

  • @anakin513
    @anakin513 2 роки тому +6

    Any tips on improving power for stubbed GPUs that are passed through to VMs? My guess is unraid isn't able to do anything with those since they are disabled in the VFIO config.

    • @patrickmartin4482
      @patrickmartin4482 2 роки тому

      i am doing crypto mining on windows VM, just install MSI afterburner as example and lower the power, increase memory etc. If they are passed through, you manage them on the new OS without any issues.

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +2

      Hi Jason. Yes when stubbed Unraid cant manage the device. The guest OS will manage the device (an its power) when passed through. So when the VM is stopped the GPU will not have efficient power management. However you dont have to stub the GPU to pass it through (normally you dont anyway) so then when the VM is off Unraid can manage it. If you have to stub it I would suggest not turning off the VM as then you will get better power efficiency than you would if you shutdown the VM

    • @lucascannell4418
      @lucascannell4418 2 роки тому +1

      @@SpaceinvaderOne I found with my gtx 960 I was passing through to a windows 10 vm I had to stub it or the nvidia driver would not let go of it crashing th vm manager if you don't normally need to stub them any idea why I do?

    • @joelang6126
      @joelang6126 2 роки тому

      I have a few GPUs passed through to VMs. None draw any additional power

  • @DTech101
    @DTech101 2 роки тому

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

  • @Diabeet1981
    @Diabeet1981 Рік тому +1

    nice vid love these kind of tweaks only thing is line 17 of the script i had to change "pid" to pid otherwise it wouldn't work for me because "pid" wasn't valid in Nvidia-SMI anymore using unraid 6.12.6

  • @Thx_And_Bye
    @Thx_And_Bye 2 роки тому

    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.

  • @philk12
    @philk12 2 роки тому

    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.

  • @ierosgr
    @ierosgr 2 роки тому +1

    Isn t installing the Nvidia drivers in contradiction of the procedure of passing through the device at first place? If i can recall main purpose of passing through something is the main hypervisor doesn t use it at all (so it doesn t load any drivers) in order for the card to be available to be passed through.

  • @Snapskauz
    @Snapskauz 2 роки тому

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

  • @BLKMGK4
    @BLKMGK4 2 роки тому

    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!

  • @jdmgtfour
    @jdmgtfour 2 роки тому +2

    I have a friends EVGA 1080 Hybrid that has been reporting around 15w at ideal since I installed it. Running the script didn't change anything but I figure the power usage is due to the fan and pump that are running off the card. Either way I can't complain as the card only cost me access to Plex. Still going to have the script set up to run hourly, thanks for the videos as always.

  • @rivinscommunity
    @rivinscommunity 2 роки тому

    Thanks for the video and script ❤️

  • @FeistyAcorn
    @FeistyAcorn 2 роки тому

    This works great! Thank you!

  • @Kentsfield1979
    @Kentsfield1979 2 роки тому

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

  • @TomFoolery9001
    @TomFoolery9001 2 роки тому +1

    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?

    • @KaldekBoch
      @KaldekBoch Рік тому

      Good question, and one I'm also curious about.

  •  Рік тому

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

  • @WesCrockettCA
    @WesCrockettCA 2 роки тому

    HUGE! Thanks!

  • @colencasey7761
    @colencasey7761 2 роки тому

    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

  • @kodeypatterson8973
    @kodeypatterson8973 2 роки тому +1

    What is SteamDeck TrueNas script?

  • @Magnum_PI-1
    @Magnum_PI-1 2 роки тому +1

    Could do with a scrypt for AMD

  • @bkinder83
    @bkinder83 2 роки тому +1

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

  • @robertwhiteoak2982
    @robertwhiteoak2982 Місяць тому

    As always Ed, great work! Lifesaver.
    I have Ollama docker running by joly0 and notice the script also shuts down that container.
    any suggestions?

  • @JustARandomSomething
    @JustARandomSomething 2 роки тому +3

    Thanks!,, what did you use to check the total power usage? and also how do you display the fan speed on dashboard?

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +2

      Power usage is from a sonoff plug flashed with tasmota firmware. Fan on dashboard is from cpu temperature plugin (also shows fans with that)

    • @JustARandomSomething
      @JustARandomSomething 2 роки тому

      @@SpaceinvaderOne Ahh, thanks. I have that plugin. It doesn't show my fans on the settings. I'd guess they're too basic.

  • @danielcollins7714
    @danielcollins7714 2 роки тому +1

    Any hacks on a Threadripper PRO?
    I’m pulling 270w (6 drives, 2 GPUs) and since the electric prices have doubled, it’s killing me!

  • @KegRaider
    @KegRaider 2 роки тому +1

    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!

  • @Eli0569
    @Eli0569 2 роки тому

    Awesome and thanks!!

  • @dragons-5890
    @dragons-5890 2 роки тому

    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.

  • @GitPush1
    @GitPush1 2 роки тому +1

    I feel like this is a stupid question, but here it goes... Does this apply to devices passed through to a VM? I suppose unRAID couldn't see them for the driver to make a difference?

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +3

      Hi Britton. No thats not a stupid question at all. Yes whilst the GPU is being passed through to a VM then Unraid cant see or manage it. During this time it will be managed by the guest OS. When the VM is stopped and its passed back to the host then the host will manage the device. The exception is if the device has been stubbed (bound to VFIO) then Unraid has no access to the device at all. Thanks for watching :)

    • @flightsimdeskuk
      @flightsimdeskuk 2 роки тому

      Presumably if it is passed through to a VM, the nVidia driver inside the VM will correctly set the power profile?

    • @eierund
      @eierund Рік тому

      So if it’s been stubbed (bound to VFIO) will the graphics card by default be in power save mode when I’m not running the VM? Or how would I be able to put the card in power save mode in that case?

  • @IEnjoyCreatingVideos
    @IEnjoyCreatingVideos 2 роки тому

    Good video Ed! Thanks for always sharing with us!👍💖😎JP

  • @pauly5497
    @pauly5497 3 місяці тому

    Hi! I've been watching your channel for a while now with unraid. I understand this is an old video, but could you tell me why this might also be causing my ollamabackend container to also keep crashing? Do you think this is related or no?

  • @RS-sd4cr
    @RS-sd4cr 2 роки тому

    thanks! you are the best.

  • @groot_the_xj
    @groot_the_xj Рік тому

    Thank you very much!!!

  • @Ridg
    @Ridg 5 місяців тому

    amazing thank you, wasn't worried so much about the power but my A2000 was sitting at 60 degrees (idol) running your script has dropped the temp right down

  • @Max-ok8js
    @Max-ok8js 2 роки тому

    Great Tip!

  • @zombieschandmaul1587
    @zombieschandmaul1587 2 роки тому

    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

    • @pedrovillalobos9859
      @pedrovillalobos9859 2 роки тому

      Which GPU do you have? Are all the drivers properly installed?

    • @zombieschandmaul1587
      @zombieschandmaul1587 2 роки тому

      @@pedrovillalobos9859 i have the Nvidia Quadro P400 and i just did like in the video. the gpu reports Load,Temperature and Processes but no power usage

  • @succuvamp_anna
    @succuvamp_anna 2 роки тому +2

    That script looks a lot more involved than the one I'm using, I tagged you in a thread on the unRAID forums for that, can you check that and let me know what you think? After 12 days of uptime the GPU enters and exit throttling mode correctly with the one in that forum post.

    • @coltonmilne1371
      @coltonmilne1371 2 роки тому

      Can you link the thread here?

    • @AeleosGFX
      @AeleosGFX 2 роки тому

      I would also like a link to the thread

  • @vincenzogiusto3328
    @vincenzogiusto3328 Рік тому

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

  • @djrobka22
    @djrobka22 11 місяців тому

    THANK YOU!!!!

  • @techpchouse
    @techpchouse 2 роки тому

    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

  • @zeke7515
    @zeke7515 Рік тому

    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.

  • @mindcraft5875
    @mindcraft5875 2 роки тому

    thanks you helped me with the lodged for jay

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому

      Your welcome mind craft. Thanks for watching :)

  • @kimsonvu
    @kimsonvu 2 роки тому

    Love you!

  • @ChrisHolzer
    @ChrisHolzer Рік тому

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

  • @tetricz
    @tetricz 2 роки тому +4

    Wouldn't this script kill any transcoding processes when it runs. Isn't it better to just enable persistence mode and let that handle the power states.
    From personal testing I found it stays in state P0 for only a few minutes after finishing whichever tasks it was doing. Then quickly scales down to power state P8. Then it scales up to P0 for any demanding enough task.
    Basically I run at startup of the array
    #!/bin/bash
    nvidia-persistenced --verbose
    nvidia-smi -pl 175
    The pl just applies an upper power limit. It's just a nicety

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +7

      The script checks if any processes are using the GPU on Unraid (ie transcoding) and if a process is active it will not change anything so not kill any transcodes.

    • @tetricz
      @tetricz 2 роки тому

      @@SpaceinvaderOne ah okay

    • @techpanda2022
      @techpanda2022 2 роки тому

      His latest script checks for processes using a pid check. If you have the original script (which will automatically kill all running processes) you will need to copy and paste the newer script.

    • @ChrisHolzer
      @ChrisHolzer Рік тому

      @@SpaceinvaderOne in that case I could have a custom cron invervall to execute the script every 15 minutes. :)

  • @derfacecrafter1869
    @derfacecrafter1869 2 роки тому

    Is it possible to lower the max power usage of an nvidia gpu?
    My powersupply is 75W less powerrful than it has to be.
    Or I did something wrong.
    Xeon 2288g 8x 18TB Exos, 2 nvme, quadro rtx 5000.
    Seasonic px fanless 450

  • @sKuNKdoSE
    @sKuNKdoSE 2 роки тому

    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! :)

  • @morgancairns2846
    @morgancairns2846 9 місяців тому

    Is it worth me doing it? The GPUs (gtx 1060) says around 9watts at idle using the statistics

    • @SpaceinvaderOne
      @SpaceinvaderOne  8 місяців тому

      Yeah 9 watts isn't alot. But you have nothing to loose using it.

    • @morgancairns2846
      @morgancairns2846 8 місяців тому

      @@SpaceinvaderOne looks like 9 watts was it’s idle state. The nvidia drivers were doing it automatically. However, after the most recent Unraid version or the new nvidia drivers, idle wasn’t coming on automatically so I have set up the script and it’s working a treat! Thanks spaceinvaderone, I’m a new Unraid user and your videos are entertaining and informative, loving this new hobby!

  • @pedrovillalobos9859
    @pedrovillalobos9859 2 роки тому

    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.

    • @eierund
      @eierund Рік тому

      Hey so does this power saving tip also work when you pass through the graphics card to a VM? Seems like there’s issues when you pass it through and install the Nvidia drivers?

  • @Mat0093
    @Mat0093 2 роки тому

    Thanks!

  • @Mo2Lab
    @Mo2Lab 2 роки тому

    Is there a way to do this even when the GPU is passed through to a VM sometimes?

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому

      Yes you can do this and passthrough the same GPU. Powersaving will happen when the VM is not running. The script running once an hour checks the powerstate and if vm not running it will chnage it into a low power state

    • @danielcollins7714
      @danielcollins7714 2 роки тому

      @@SpaceinvaderOne even if the GPU IOMMU is bound to VFIO at boot?

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому

      @@danielcollins7714 No if the GPU is bound to VFIO then Unraid doesnt have access to the device itself even when the VM is not running. In that case its best to leave the VM always running so the card gets power management from the guest OS. However you don't have to (in most cases) stub the card for passthrough.

    • @eierund
      @eierund Рік тому

      In which cases would you have to stub through the card?

  • @rolliseventeen
    @rolliseventeen 10 місяців тому

    i notice you still do hard work on this script. i just borrowed a old Quadro 2000 to check this feature. 🙂

    • @rolliseventeen
      @rolliseventeen 10 місяців тому

      feature is ok, but the fan from the old quadro spinning on high rpm, too high. :-(

  • @caennanu
    @caennanu 2 роки тому +1

    Loving this. too bad i have no gpu's that are not assigned.

  • @jan883
    @jan883 2 роки тому

    Thanks! Does this script have any effect on gpu pass-through to a vm? Is it still possible or does it lead to conflicts?

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +2

      Yep fine to use if you have passthough. It will save power whilst the VM is off. When VM is running the vms OS will manage the power.

  • @kazolar
    @kazolar Рік тому

    wow dropped my 3060ti from 47 to 24. Awesome

  • @p0larz0mbies
    @p0larz0mbies 2 роки тому

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

  • @johnnywoolen1453
    @johnnywoolen1453 2 роки тому

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

    • @jafizzle95
      @jafizzle95 2 роки тому +1

      From one of his comments to another similar question:
      "The power usage if from a Sonoff Pow R2 smartplug flashed with tasmota firmware"

  • @acrusso1
    @acrusso1 2 роки тому

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

    • @mrmtb
      @mrmtb 2 роки тому

      Make sure you're running Balanced power state rather than Performance...

  • @methanoid
    @methanoid 10 місяців тому

    How about AMD users??

  • @tritech
    @tritech 2 роки тому

    I would like to see the actual wattage at the wall difference using something like a kill-a-watt/ smart plug

    • @Mo2Lab
      @Mo2Lab 2 роки тому +3

      Didn't he do exactly that?

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +3

      The power usage if from a Sonoff Pow R2 smartplug flashed with tasmota firmware

  • @meccu19
    @meccu19 2 роки тому

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

  • @paulpoco22
    @paulpoco22 7 днів тому

    Have a 1660 Super & 3050, saved about 40W

  • @bigbin1070
    @bigbin1070 2 роки тому +7

    AMD GPU please

  • @reoproedros
    @reoproedros 2 роки тому +1

    50w is 1200kwh per day , 438kwh per year ! almost half a megawatt . (my unraid server runs between 17 and 24 watt , i use an atom based pc )

    • @allram89
      @allram89 2 роки тому +2

      *1.2kWh pr day.

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +2

      Yeah its a good power saving. 1.2 kwh a day saving (here in UK my power is £0.38 kwh) over a year will save me £138. Wow your server is super efficient thats great, I wish my server was a bit more power efficient. Thanks for watching :)

  • @mrg3dit2002
    @mrg3dit2002 2 роки тому

    my p400 saved 8w, thanks.

  • @Cra1gst
    @Cra1gst Рік тому

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

  • @songworks17
    @songworks17 Рік тому

    A year later, this is still a problem apparently. Anyway, thank you!

  • @Spontan_DJ
    @Spontan_DJ 10 місяців тому

    X99 Mainbaords laufen auch Ohne Grafikarte ohne IGPU

  • @Teleon19
    @Teleon19 2 роки тому +2

    click video - like video - watch video.

  • @rivinscommunity
    @rivinscommunity 2 роки тому

    Hey

  • @iolsen94
    @iolsen94 2 роки тому

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

  • @robotblut7522
    @robotblut7522 2 роки тому

    THANKS 3080

  • @donny_bahama
    @donny_bahama 2 роки тому

    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.

    • @SpaceinvaderOne
      @SpaceinvaderOne  2 роки тому +2

      This is for people who already have an Nvidia gpu in their server. It isnt a suggestion to buy a new GPU :)

  • @amateurwizard
    @amateurwizard 2 роки тому

    Thanks 👍