Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 18.04 NVIDIA - GPU stuck on performance level 0 when on battery #501

Open
atasoglou opened this issue May 16, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@atasoglou
Copy link

commented May 16, 2019

On surface book 2 with Ubuntu 18.04 using NVIDIA drivers and kernel 5.0.10-surface-linux-surface:

  • When on battery, GPU is stuck on performance level 0, which restricts the GPU to work between 139-607MHz. As a result the whole desktop is laggy, as GPU is constantly at 100% but under-performing because of the frequency restriction.
  • When plugged-in the power, everything is normal, GPU can go up to level 4.

Is this related to the acpi developments maybe?
Tested with NVIDIA drivers 390, 415 and 430 - all same behavior.

@qzed qzed added the D-Book2 label May 17, 2019

@qzed

This comment has been minimized.

Copy link
Collaborator

commented May 17, 2019

First off, I'd generally suggest you use the Intel GPU for your desktop usage, as this will give some considerable power savings, and only use the dGPU for the applications that need the performance, i.e. via optimus.

To set this all up, you basically only need to install https://github.com/qzed/linux-surfacebook2-mshw0153 and optimus. I also recommend you install https://github.com/qzed/linux-surface-control (which provides the surface commend), as this allows you to change the settings (e.g. power-on/off the dGPU more easily). By default the module will disable the dGPU at startup, so that you can later enable it (e.g. via sudo surface dgpu set on) and use it via optimus.

Additionally to that (or if you specifically want the dGPU as main GPU), you can change the performance mode (e.g. sudo surface performance set 4). This won't give you the full power of the dGPU (will always be limited without AC), but should give a good improvement. Here are a bit more details to that.

@atasoglou

This comment has been minimized.

Copy link
Author

commented May 20, 2019

Yeah, I agree with you. However, my line of work requires the GPU, so I need to stick with it. Normally, while working, I have it plugged in, but if it happens that I need to grab my laptop for a meeting, then it is kinda annoying cause the desktop becomes super laggy.

Anyway, I will try your suggestion with the surface-control. Thanks a lot!!

@qzed

This comment has been minimized.

Copy link
Collaborator

commented May 21, 2019

If you need it for anything graphical, I suggest you look into optimus (if you use cuda, you don't even need that, just select the dGPU). Via optimus, you can use the dGPU for the application that requires it and the iGPU for the rest.

@atasoglou

This comment has been minimized.

Copy link
Author

commented May 22, 2019

Good advice, thanks! Works in my case, as I need the dGPU mostly for CUDA. So bbswitch+optimus working fine! I am using now Intel for anything graphical.

@ZHG2017

This comment has been minimized.

Copy link

commented May 31, 2019

@qzed Hi, sorry to bother you again. I saw in your comments you mentioned that it was not even necessary to use optimus for CUDA coding, did I understand this correctly ? I am interested in coding some CUDA programs so I wonder if I could just activate the integrated GPU with Intel's CPU while coding and testing my CUDA code without the need to switch to dGPU. thank you in advance !

@qzed

This comment has been minimized.

Copy link
Collaborator

commented May 31, 2019

@ZHG2017 Yes, optimus is only necessary for graphics, or more strictly speaking, if you want to render a window on a different GPU.

If you want to do compute stuff, you can use the Intel GPU for your desktop environment etc. and the dGPU for CUDA. Just turning on the dGPU and loading the drivers should work. CUDA will then automatically detect it (since it can't run on the Intel GPU, it's the only GPU it can detect) and should use it without you having to configure anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.