NVIDIA Optimus and Linux - Are You Burning Power For No Reason?

Sdílet
Vložit
  • čas přidán 8. 08. 2020
  • This wasn't planned, so sorry for the lacklustre presentation.
    To clear up the technology naming, PRIME is a rendering offload technique, whereas Optimus is the dual GPU solution. So all systems using PRIME are Optimus configurations, but not the other way around.
    Setting up the xorg.conf automatically:
    us.download.nvidia.com/XFree8...
    Then add `Option "AllowNVIDIAGPUScreens"`.
    Running things with PRIME offloading:
    us.download.nvidia.com/XFree8...
    I have a second channel:
    / @markfurneaux2659
  • Věda a technologie

Komentáře • 86

  • @muchvibrant
    @muchvibrant Před 3 lety +17

    use "watch -n1 sensors" or "watch -n1 nvidia-smi" instead of running these commands again and again...

  • @DC123Gaming
    @DC123Gaming Před rokem +1

    great video, lots of useful information and exactly what I was looking for, thanks!

  • @Tesla42
    @Tesla42 Před 3 lety +3

    You can completely disable the card with: echo "OFF" > /proc/acpi/bbswitch

  • @Roruoni
    @Roruoni Před rokem +6

    I found some kernel module options for power management. Here is an excerpt from the Nvidia manual for NVreg_DynamicPowerManagement.(you can place these lines in a text config file /etc/modprobe.conf and /etc/modprobe.d/*.conf)
    Option "NVreg_DynamicPowerManagement=0x00"
    With this setting, the NVIDIA driver will only use the GPU's built-in power management so it always is powered on and functional. This is the default option, since this feature is a new and highly experimental feature.
    Option "NVreg_DynamicPowerManagement=0x01"
    With this setting, the NVIDIA GPU driver will allow the GPU to go into its lowest power state when no applications are running that use the nvidia driver stack. Whenever an application requiring NVIDIA GPU access is started, the GPU is put into an active state. When the application exits, the GPU is put into a low power state.
    Option "NVreg_DynamicPowerManagement=0x02"
    With this setting, the NVIDIA GPU driver will allow the GPU to go into its lowest power state when no applications are running that use the nvidia driver stack. Whenever an application requiring NVIDIA GPU access is started, the GPU is put into an active state. When the application exits, the GPU is put into a low power state.
    Additionally, the NVIDIA driver will actively monitor GPU usage while applications using the GPU are running. When the applications have not used the GPU for a short period, the driver will allow the GPU to be powered down. As soon as the application starts using the GPU, the GPU is reactivated.
    It is important to note that the NVIDIA GPU will remain in an active state if it is driving a display. In this case, the NVIDIA GPU will go to a low power state only when the X configuration option HardDPMS is enabled and the display is turned off by some means - either automatically due to an OS setting or manually using commands like xset.
    Similarly, the NVIDIA GPU will remain in an active state if a CUDA application is running.
    Option NVreg_DynamicPowerManagement can be set on the command line while loading the NVIDIA Linux kernel module. For example,
    modprobe nvidia "NVreg_DynamicPowerManagement=0x02"

  • @brotherbear6434
    @brotherbear6434 Před 3 lety +5

    It works out of the box on non Debian Distros. Manjaro works perfectly

  • @NFvidoJagg2
    @NFvidoJagg2 Před 4 lety +1

    so i have a 2014 hp envy15 with an i7 and 850m. I was running mint on it since 2016-17 and I found when running specifically with NVIDIA i would get about 1h50m (note this is with intelij and Firefox open.) and when I ran it with just the Intel as soon as my laptop hit 50% the battery would instantly drop to 0% and I wounder if this might be the case. recently I installed pop_os (two weeks ago) on the machine as system78 has laptops with a similar config. So I haven't been able to really test it but i just ran through their GPU switcher and found when set to integrated. nvida-smi is not even available. when in hybrid there are two xorg processes. in compute there are none but nvida-smi is available. (note i'm not seeing the actual power consumption from smi. this might be a config or hardware thing with my system) i'm guessing pop_os is doing the same thing of having a process open for battery and having a handle on the GPU when it needs to switch. IDK i'm just guessing based on my observation. I need time to sit down and benchmark it.

  • @staideysstudio4637
    @staideysstudio4637 Před 2 lety +3

    You can fully disable the Nvidia GPU by editing ACPI tables.
    Although, you will have to use a custom bootloader that lets you inject SSDT's like Clover

  • @saumitit944
    @saumitit944 Před 2 lety

    Thanks for the great explanation :) rllyy helpful

  • @LacerdaJPF
    @LacerdaJPF Před 3 lety

    Thank you friend,
    Very good explanation.

  • @nothing3386
    @nothing3386 Před 2 lety

    @Mark Furneaux I have more or less the same system and I am wondering if you or anyone else knows how to fix Debian so it works or has a good iso file for Debian testing with optimus + amd switchable.

  • @makrand1584
    @makrand1584 Před 4 lety

    That's interesting. I have MSI GL 63 8RD with mint 19.3. Although gtx 1050Ti has optimus support, I was never able to setup successfully. So I run with onboard graphics all time & can switch between dgpu & igpu manually.
    That Nvidia utility, is it available as binary anywhere?
    Offtopic -
    Mark, you should use simplescreenrecorder for screencast. It does superb job of video/audio at same time.

  • @rojin8301
    @rojin8301 Před 2 lety

    Nice explanation!

  • @ozonewagle
    @ozonewagle Před 3 lety +1

    bro please list commands,, very hard to see

  • @Moonblade042194
    @Moonblade042194 Před 4 lety +10

    Why not just power off the pcie device from the kernel? Pretty standard thing to do if you never plan to use the Nvidia card

    • @Moonblade042194
      @Moonblade042194 Před 4 lety +2

      Here is a guide for this wiki.archlinux.org/index.php/Hybrid_graphics#Fully_Power_Down_Discrete_GPU

    • @TheUbuntuGuy
      @TheUbuntuGuy  Před 4 lety +15

      This is a good idea and I should have mentioned it. However I can't use it in my case because there is no entry in the ACPI tables for controlling the discreet GPU. ASUS really didn't give a shit with the BIOS on this laptop; it didn't even suspend/resume without ACPI tweaks.

  • @jorgeszabo1659
    @jorgeszabo1659 Před 4 lety +1

    Just out of curiosity because I'm looking into buying a new laptop in the near future, Is there any reason to buy one of these powerful machines with a dedicated gpu if it's basically never going to be used? Like having a better build quality or better thermals than regular thin and light laptops.

    • @Moonblade042194
      @Moonblade042194 Před 4 lety

      You can't get 6 and 8 core CPUs in laptops without dedicated GPUs because the laptop manufacturers don't offer those SKUs

  • @mikenelson9790
    @mikenelson9790 Před 11 měsíci

    On my Lenovo laptop i can go to the BIOS and just turn off switchable graphics, forcing my laptop to use the intergrated one.

  • @robotstronghold6195
    @robotstronghold6195 Před 4 lety

    Isnt that basically what looking glass is intended to do, but through a virtual machine?

  • @abhishekb9712
    @abhishekb9712 Před 3 lety

    thank you soo much, sir :)

  • @WizardTim
    @WizardTim Před 4 lety +5

    I’ve never had good experiences with any power management, I’ve had the same problem with older NVIDIA GPUs but also even with iGPU only machines power management ruins my day. The most common problems I’ve had are with sleep modes, both on Linux and Windows I’ve had many problems with S3 power state not being entered correctly even with Windows on a Microsoft Surface! They would either just stay in S0 forever and waste the battery or never come back from S3 until the battery slowly discharged. That sort of fault makes a laptop completely useless if you’re rolling the dice every time you turn it off, modern Windows disguising ‘shutdown’ as ‘hibernate’ doesn’t help either.
    I’ve also had power management problems with Windows Phone 10 not correctly turning off peripherals (although it was an early preview build they dropped support for the phone soon after they promised not to).
    Although I do feel for those who have to develop power management features, I’ve had a fair share of developing firmware for long term low power devices on both Atmel and Espressif platforms, always involved plenty of troubleshooting strange behavior and digging through long and complex documentation.

    • @JessicaFEREM
      @JessicaFEREM Před 3 lety

      My laptop has a unique issue that i can't let the laptop go to sleep because the screen is too close to the keyboard so it presses the space bar when i put it in my bag, so i have to set it to go into hibernate when i close the laptop. it's aggrivating.
      Also the laptop doesn't wake from sleep without a keyboard press, so it actually isn't that much harder to just let it hibernate instead of sending it to sleep.
      and yes, all of these issues were out of the box.

  • @xan1242
    @xan1242 Před 4 lety +2

    Goddamnit man that is the exact laptop I have.
    I have the FX505DU and it has a 1660 Ti (non Max Q), yours should too.

  • @Tjousk
    @Tjousk Před 4 lety

    Good info

  • @4833504F
    @4833504F Před 4 lety +1

    there's a kernel module for switching the dedicated gpu off without the help of any nvidia driver software: github.com/Bumblebee-Project/bbswitch
    it's available as a package in archlinux, don't know about ubuntu and others.

  • @visoneselektah
    @visoneselektah Před 3 lety +3

    I don't really see the advantage of using 2 gpu at the same time, it's just power lost. Personally I use slimbookbattery for power management and optimus switch amd for choose between gpu. I usually use de igpu and oly active de gpu when I need the hdmi output.

    • @idkidk9204
      @idkidk9204 Před 2 lety

      It might be usefull, if you have a slower dedicated gpu and an igpu then you can for example use one for gaming and other stuff like that while using igpu for docs, watching videos, record screen without using your dgpu

  • @cun_0092
    @cun_0092 Před 3 lety

    optimus manager for my laptop was burning battery like anything. whether its Nvidia or Intel optimus would drain battery like water. But on prime I don't have such issue I can run any application using prime-run in terminal and program name and no problem. It depends laptop to laptop I guess. Anyways mine is turing Nvidia-gtx 1650 and in Arch

  • @mr.mastermind4840
    @mr.mastermind4840 Před 2 lety +2

    Even on 2022, it still doesn't work. So moral of the story is if you have a hybrid GPU setup, don't waste your time and install Windows.
    Optimus Manager is still buggy. Prime run isn't working properly either

  • @eldyj
    @eldyj Před 2 měsíci

    2:31 pop! os has nvidia support, there's separate iso for that even
    actually very useful, since i use artix and don't want to change anything (except configuring gpu)

  • @jaro6985
    @jaro6985 Před 4 lety +2

    1.25A * 12.3V - 0.9A * 12.3V = 4.3W, so the driver estimation of 3W less was a bit low, maybe rounding. Sounds like it can go even lower too:
    P0/P1 - Maximum 3D performance
    P8 - Basic HD video playback
    P12 - Minimum idle power consumption

    • @k3ff793
      @k3ff793 Před 2 lety

      very low amp draw...

    • @jsoares91
      @jsoares91 Před rokem

      Could you figure out how to change the power state to level 12?

    • @jaro6985
      @jaro6985 Před rokem

      @@jsoares91 Sorry I have no idea.

  • @btno222
    @btno222 Před 3 lety +1

    Or try installing TLP for power management and adjusting gov, power management

  • @JessicaFEREM
    @JessicaFEREM Před 4 lety +1

    My asus laptop with a passively cooled intel CPU gets like 8 hours on a charge, but then again, that laptop has a larger battery than yours, and my main laptop, a POS walmart brand has a 45Wh that drains in like 3 hours with aggressive power management.

  • @jagdtigger
    @jagdtigger Před 4 lety +5

    IDK, PoP_OS (Ubuntu fork) has a switch for it without any mods. You have to reboot to switch but thats not that big of an issue IMO.....

  • @postmodernist1848
    @postmodernist1848 Před rokem +1

    I have the same laptop and after 2 years this has probably been fixed, because nvidia-smi showed p8 and 2 watts without any X configuration with the 535 driver. The sensors showed the same numbers before and after, though they were different from the video (around 11 volts and 1.4 amps). The distro used is Arcolinux b

    • @yourlinuxguy
      @yourlinuxguy Před rokem

      Well, doesn't doing nvidia-smi pings the gpu and thus draws some power usage?

    • @az9az9az9
      @az9az9az9 Před 8 měsíci

      Not fixed yet in Kubuntu 23.10, Legion Slim 5, 7840HS, RTX4060. 535 total idle power draw 22W, Nouveau driver 7W.

  • @prajjwalsingh6490
    @prajjwalsingh6490 Před 3 lety +1

    Use bbswitch to completely turn off the nvidia gpu

  • @JessicaFEREM
    @JessicaFEREM Před 4 lety

    the thing is that ryzen APU's are stupid efficient, so wasting that power is sucky
    the thing i hate about not using the GPU, is that it feels like a waste of money, so unless you play games, you're better off getting something like a dell XPS, if they ever started using ryzen and including thunderbolt

  • @k3ff793
    @k3ff793 Před 2 lety

    nvidia relesad some dsp for cuda. it removes noisr perfect. have tried it in win. so im trying to share the gpu via ethernet from a linux machine. forgot how. did something with usb ports. tnx for explaining stuff edit. cpyrit on todo list too :)

  • @userpeaseonly
    @userpeaseonly Před 5 měsíci

    That is what I want bro I have been searching for this for a long time after getting brand new gaming laptop which I cannot use without installing ubuntu

  • @EmancipatedSquirrel
    @EmancipatedSquirrel Před 4 lety +6

    This is why Linus Torvalds cussed nvidia that one time..

  • @juliankandlhofer7553
    @juliankandlhofer7553 Před 4 lety +1

    Now it really is a NoVideo gpu.

  • @EnrysonFerraz
    @EnrysonFerraz Před 3 lety

    maybe on pop os works out of the box

  • @rushi7312
    @rushi7312 Před rokem

    Works out of the box with Pop!_OS.
    But I switched to Arch now :D

  • @eltereding
    @eltereding Před 4 lety +1

    i dont know if the consumer series support most of the smi commands but you could try forcing a max power limit "nvidia-smi -i 0 -pm 1 -pl 1" would lock the card at max 1watt power consumption. the card should not stay in P0 without any process, that looks like a bug. at least in my experience with datacenter gpus this is not the normal behavior.

  • @mevlentips9844
    @mevlentips9844 Před rokem

    It's the driver I had it on numerous laptops.Its hard to find a good one on windows don't let me started on linux.But I just take the mxm gpu out when booting linux.then I'm good.For other laptop that runs windows only I just use vmware linux is best to use only on igpu or as desktop server station.

  • @dsedchenko
    @dsedchenko Před 2 lety

    You also can completely turn off a GPU by doing an appropriate acpi call at boot time.

    • @yourlinuxguy
      @yourlinuxguy Před rokem +1

      Could you share some guide or something?

  • @byAnArgentinian
    @byAnArgentinian Před 4 lety +1

    great interesting. Is this something that should not happen with AMD?

    • @4833504F
      @4833504F Před 4 lety +2

      don't think there are any laptops with an igpu + dedicated amd gpu. and if there are, you'll most probably have the same problem of needing at least some kind of power management driver

    • @mparagames
      @mparagames Před 2 lety +1

      @@4833504F well, now there are; and i'm npt sure about how their power management is exactly but it's probably better

    • @wertiaaudit5746
      @wertiaaudit5746 Před 2 lety

      @@4833504F probook 6470b

  • @btno222
    @btno222 Před 3 lety +1

    Bumblebee its a dual graphics, so you would need bumblebee when you play steam games

    • @yaajfcomments7171
      @yaajfcomments7171 Před 3 lety

      It depends on the driver version, newer nvidia drivers are not compatible with bumblebee, but can work with vulkan, so for newer nvidia drivers on the optimus laptops you'll need nvidia-prime package, it contains prime-select command, among other things. With drivers that were compatible with bumblebee, you could choose among two options with prime-select: nvidia or intel. Newer drivers bring the third option - on-demand, but 'prime-select on-demand' is not enough for offload to work. And there is where the "fun" begins ;] On Arch systems there is 'prime-run' command that suppose to be used like optirun command. There is no such thing in Ubuntu online documentation, but in Debian Wiki there is page about NVIDIA Optimus and there is mentioned that you need to run programs with two environment variables set to make this program use nVidia GPU: __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia
      Easy-peasy XD
      Newer versions of GNOME have menu options to run programs with those variables, I've written a simple wrapper with those variables and named it prime-run :D
      Unfortunately I don't know how much power my card take on-demand because I don't have power in my nvidia-smi or nvtop.

  • @btno222
    @btno222 Před 3 lety

    Try Linux Mint 20, you can try installing the dual graphics , bumblebee! Battery life

  • @btno222
    @btno222 Před 3 lety

    Think of it dis way use tlp, and bumblebee, and it can utilize PM or utilize Manjaro tlp, and the bumblebee switch off from onboard graphics or wen gaming or kody to descreet graphics nvidia!

  • @slaps1
    @slaps1 Před 4 lety +1

    I could simply disable the dGPU in the bios luckily

    • @MnemonicCarrier
      @MnemonicCarrier Před 3 lety

      A lot of laptops no longer have this option. A laptop I had only had GPU options for: "Discrete" (the Nvidia dGPU), and "Hybrid" (power managed selection via software). Whenever I selected "Hybrid", the dGPU (Nvidia GPU) would still be powered up, so I'd have to dig around to find out how to power it down - and it wasn't easy and straight forward.

  • @4zims
    @4zims Před 4 lety +3

    ASUS TUF series laptops build quality is bad.

  • @cianmoriarty7345
    @cianmoriarty7345 Před rokem

    I got a fx506 😁

  • @abay931
    @abay931 Před rokem

    I checked today, it's using more than windows power

  • @n7565j
    @n7565j Před 4 lety

    Guess this hasn't been a priority with the coders... But, more and more Linux guys & gals are using these souped up rigs so maybe they'll take notice.
    Especially since you were kind enough to go through the trouble of making a video :-)

  • @Fakeman
    @Fakeman Před 4 lety +3

    was looking for it for years and searching Optimus instead of prime. NVIDIA is a joke especially on Linux. they expected you to reboot everytime you need to swap to the DGPU unless you use bumblebee or something similar. lol

    • @yourlinuxguy
      @yourlinuxguy Před rokem

      Hey, Did you find any ways to not reboot and change the GPU's ? Have they done something good now?

  • @techzone2009
    @techzone2009 Před 4 lety +2

    Linux is bad with graphics card driver .. special if you have integrated GPU+ dedicated GPU.... windows does this in better way

    • @potatogod3000
      @potatogod3000 Před 4 lety +3

      Its actually the graphics companies (NVidia) that doesn't support linux. Not linux's fault, NVidia's fault for not supporting this Prime Technology under Linux.

    • @techzone2009
      @techzone2009 Před 4 lety +1

      @@potatogod3000 even in open source driver of AMD lacks this feature. .. I think developer need to focus on arm laptop and Linux ...we lacks app in arm side ....

    • @potatogod3000
      @potatogod3000 Před 4 lety +1

      @@techzone2009 yeah true.. hope we get more attention from devs in future. For that we at least need 5% or more market share. Hope that we can reach there quickly.... :)

  • @jcbritobr
    @jcbritobr Před 11 měsíci

    dont use nvidia gpus with linux. Always have bad experiences. I uninstalled it as I dont use for gaming. Now my laptop is in good temperature and have more battery time.

  • @okEther
    @okEther Před 3 lety

    Review random shit from eBay again

  • @peter3867
    @peter3867 Před 4 lety +6

    16 mins for literally 60s of information. 😔