2

I'm on Ubuntu 19.04 with a Nvidia GTX 1050 Mobile, using the latest nvidia-driver-430 from the ppa.

In the PRIME profile, I have selected Nvidia instead of Intel. It seems like this is acknowledged (OpenGL ES 3.0 Renderer: GeForce GTX 1050 with Max-Q Design/PCIe/SSE2). nvidia-smi also reports that the GPU is under load.

However, this is where it gets strange: The size of the window which renders 3D OpenGL graphics has a huge effect on performance. Most of the time (not always!) a window sized at 720p or below is as performant as I'd expect it to be, and the CPU load is minimal. However, resizing it to be larger causes everything (even the OS itself) becomes incredibly laggy due to the graphics processing load.

I think that somehow, Intel graphics are used with larger windows. The reason is that there is a major increase in CPU usage when this happens. nvidia-smi does still also show the GPU-Util at 100% and the program in the Processes tab though...

I'd really appreciate some help since the performance is really unbearable with full-screen windows.

I'm mainly noticing this as a big problem with the Godot engine. Edit: It also only happens in Godot with GLES3, not with GLES2, so it could be a GLES3 problem with my system!

Edit: This is an example of how the CPU usage looks when resizing the window just a bit above the lag threshold, and then back down: https://i.stack.imgur.com/AKMDZ.png With more complex 3D scenes, the jump can get much higher. When this happens, FPS go down from >60 to around 10 in an almost empty scene.

That threshold somehow seems to be a bit different after each reboot.

8
  • It may be an issue with the driver but as you said, you have latest one. First, I would recommend enabling/changing your compositor. It should be in your window settings, but it will vary with different desktop environments. Please tell me what the current compositor is and the options you can change it to. Sep 9, 2019 at 17:36
  • @TheMATEMan I'm using default Ubuntu 19.04 with the GNOME Shell.
    – kb173
    Sep 9, 2019 at 21:00
  • @TheMATEMan To expand on your suggestion: I tested it with Xfce as well as Ubuntu on Wayland. With Xfce it was as bad as before, possibly even worse. Ubuntu on Wayland seems to only use the integrated graphics, which are actually much better - they don't have that weird spike when enlargening the window, they're consistent at the performance I'd expect. Of course, I'd like to use my Nvidia card though. Also possibly relevant: I get stutters where the entire OS freezes for around 3 seconds when using the Nvidia GPU. This happens randomly, but especially when opening windows.
    – kb173
    Sep 10, 2019 at 9:42
  • Actually, I have to make a slight correction: After testing more with Xfce, the threshold of the window size where the lag starts seems to be higher. It can handle an almost maximized window at the expected performance. After that, however, it does also drop off. It's interesting again that logging out and back in seems to change that threshold.
    – kb173
    Sep 10, 2019 at 10:01
  • I don’t think it is a problem with the Desktop environment. Have you tried enabling/changing your compositor? It should be in the window manager settings. Other than that, I’m not sure how else I can help you. I have never used Nvidia video cards and I know that they often have issues with Linux. If you are unable to get to the compositor settings or changing the compositor settings does not work, I would recommend getting in contact with Nvidia customer support and seeing if they have any drivers or solutions for your problem. Sep 10, 2019 at 18:08

1 Answer 1

0

I finally got this figured out:

The direct cause of this issue was that my VRAM was full! This explains why there was a certain threshold of the window size: When the window got too large, the VRAM was at 100% capacity, causing the whole OS to lag. Makes sense!

Why was Godot using so much VRAM? I have no idea. However, I got Bumblebee installed so that I can delegate only Godot to the GPU. Now as it turns out, when using Bumblebee's optirun, the VRAM usage is actually normal!

Now, getting Bumblebee working is a whole chapter in and of itself, but the responses here helped the most for me: https://bugs.launchpad.net/ubuntu/+source/bumblebee/+bug/1758243

tl;dr: Apparently, only using the GPU without Nvidia Optimus (on a laptop with both integrated graphics and an Nvidia GPU) can cause the VRAM usage of some programs to go way up for no reason. Setting up Primus/Bumblebee and using optirun fixes it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .