Help: Very Bad performances with Gnome + Nvidia

Hi

I recently changed my monitor for a 3440x1440. It is connected to a Nvidia 1030. It may be a cheap GPU, it should support the resolution from the specs, and I don’t want gaming performances, just a usable desktop that can play videos.

I wadn’t able to have descent performance on Gnome, IDK how to explain, but I have like 10fps, I can’t watch a video, and moving the windows is a pain for the eyes.
I tried “nouveau” driver, and it is a little worse.
I waited to test NixOS 23.11 but nothing changed.

The problem is not linked to my new monitor, I got the same bad visual performance with my previous 1920x1080.

I think I’m missing something in my nvidia setup. I read the wiki, tried like dozens of configurations from this forim, others, I would really appreciate some help. I like NixOS too much to get back to Debian.

Here is an extract of my config

  nixpkgs.config.allowUnfree = true;
  services.xserver.videoDrivers = [ "nvidia" ];
  hardware.opengl.enable = true;
  hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
  hardware.nvidia.nvidiaPersistenced = true;
  hardware.nvidia.modesetting.enable = true;
  hardware.nvidia.forceFullCompositionPipeline = true;

and here is xranr output

$ xrandr
Screen 0: minimum 16 x 16, current 3440 x 1440, maximum 32767 x 32767
DP-3 connected primary 3440x1440+0+0 (normal left inverted right x axis y axis) 800mm x 330mm
   3440x1440     49.96*+
   1920x1440     49.92  
   1600x1200     49.92  
   1440x1080     49.86  
   1400x1050     49.97  
...

I don’t even understand why I’m locked to 50Hz, my monitor supports 100Hz.

Any help will be appreciated,

Was the previous one working with NixOS correctly? Did you only change the screen and now you have poor performance?

It may be a cheap GPU, it should support the resolution from the specs

Maybe. Also that resolution at the desired refresh rate?

I like NixOS too much to get back to Debian.

So it worked fine on Debian with a similar setup?

I never had good performance with the Nvidia GPU.
Before, I was using the integrated Intel GPU which had fair performances, I only had a rolling barrel-like effect in videos … but nothing shocking.

Since I installed the Nvidia GPU, I never had good performance on Gnome/Wayland. Neither with the non free driver nor the nouveau driver.

I really think I’m missing something in the nvidia setup. I even tried to disable wayland to use X11, the performance were worse, like 3 fps !

Just to had more details, my Dell laptop is also on Nixos (23.05), with Optimus architecture (intel+nvidia).
The basic setup is just perfect. The screen is recognized and configurad to 100Hz, performance are just perfect.

But I struggle with my desktop :cry:

As I said a previous answer: Help: Very Bad performances with Gnome + Nvidia - #4 by seb0

I have far better performance with my integrated Intel GPU from 2012, intel i7-3770.
I would be very surprised if a NVIDIA dedicated GPU from 2017 was worse…

Could you try with an HDMI cable instead of the displayport ? (I assume it’s DP as the xrandr output says DP-3)

I will, but my previous monitor was using the HDMI output.
I changed to DP thinking like you that it may change something :slight_smile:

Since I installed the Nvidia GPU, I never had good performance on Gnome/Wayland. Neither with the non free driver nor the nouveau driver.

I used to run an AMD 5500 XT a while ago and I had bad slowdowns in Gnome/Wayland. Not as bad as you, but still going down to 20fps from 60fps when changing desktops and things like that. That was most likely due to a bug in the driver.

  • Did you try other desktop setups apart from Gnome? Maybe boot form a LiveUSB with KDE preinstalled

  • Does this happen on other modern distros? I would try booting into Fedora 39 or Ubuntu from USB to see how it goes. That comes with Gnome/Wayland by default.

I’ve been fine with nvidia performance wise for years, my main problem has been the utterly crap stability of the software, it’s always riddled with artifact-causing bugs and kernel incompatibilities.

That setting is documented as such:

This has been reported to reduce the performance of some OpenGL applications and may produce issues in WebGL. It also drastically increases the time the driver needs to clock down after load.

You probably don’t want to set it unless you have a really good reason to?

I would suggest these settings:

hardware.nvidia = {
  enable = true;
  open = true; # The open drivers are generally recommended these days
  modesetting.enable = true; # Starts the nvidia with kms, ensuring that there is no tty flicker and enabling a variety of important things down the stack
  # powermanagement.enable = true; Optional, this fixes suspend for me

  # This is the default anyway
  # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
  # This setting is for datacenter GPUs, not stuff you'd actually render desktops on
  # hardware.nvidia.nvidiaPersistenced = false;
  # See above
  # hardware.nvidia.forceFullCompositionPipeline = false;
};

From there, check the GPU utilization and temperature in nvidia-settings to make sure it’s actually being used properly.

Ok, thank you guys, there are some improvements!

@APCodes I wanted to try the latest Ubuntu live USB, so I dd the image on my USB key then I went to my BIOS to change boot order.
There, I browsed the GPU configuration, and tried to totally disable the Intel IGP since I now have a single wide screen, I don’t need the Intel GPU, only the Nvidia.

Before tryng Ubuntu, I gave NixOS a try and tadam … performances are HERE!
I get a normal and fluid Gnome Desktop, which I did not have for month now (since I switched to a dual monitor setup …)

@TLATER I tried your suggestion, but unfortunatly, open = true; prevent GDM to launch. I did not investigate more, since the documentation about this option is not very useful for me.
As you suggestion I disabled hardware.nvidia.forceFullCompositionPipeline = false; and as it works, I’ll keep it disabled.

So I don’t know exactly what the settings in my motherboard BIOS changed, but it changed it all !!
I wouldn’t have had the idea to change them without trying your ideas so thanks.

But to be complete, I don’t understand how I get the only 50 fps framerate. It is the only value available in GNome settings.
Even xrandr show me only the 50fps

Screen 0: minimum 16 x 16, current 3440 x 1440, maximum 32767 x 32767
DP-3 connected primary 3440x1440+0+0 (normal left inverted right x axis y axis) 800mm x 330mm
   3440x1440     49.96*+
   1920x1440     49.92  
   1600x1200     49.92  
   1440x1080     49.86  

Stange because as I said, I can choose between 50, 60 and 100Hz from my laptop which is also on NixOS & Nvidia…
But this issue is nothing compared to the one I just solved :slight_smile:

It’s almost certainly disabling the iGPU. You were most likely using the iGPU to render rather than your GPU in the first place, which unsurprisingly won’t keep up with >60fps on a 4K monitor ;p

Okay, I didn’t know you could render with a GPU and sending the image to a monitor with a cable plugged on a card with another GPU.
This is mindblowing to me :exploding_head:

Anyway, thanks for the help.

This is called discrete rendering, that’s exactly what nvidia card in laptops are doing when using the laptop screen for display.

However, I’m surprised this did that out of the box with your integrated GPU, usually you need a complicated setup to do discrete rendering…

Yeah, I wonder, I misread that it was a laptop and assumed that the port was simply shared to begin with, but if that’s not it then there’s some surprising behavior here.

You didn’t missread anything, it is not a laptop :slight_smile:

On my desktop, I have a ASRock motherboard with an Intel GPU integrated to my i7-3770 CPU.

Then I added a NVidia GeForce GT 1030.

I used for month a dual screen, one plugged to my motherboard, one to my Nvidia card.
I always wondered how Linux managed to “switch” from a gpu to the other when I moved a window from a screen to another … I guess @Solene is right and a GPU was rendering and the other was like a passthrough
Anyway the performance were low.

Now I have only one screen plugged to my nvidia card and the performance were lower than before !!

I tend to think the the Intel GPU was in fact used to render a 5k monitor and the Nvidia was just in a passthrough mode. That would explain the ultra low performances.

By deactivating the Intel GPU in the bios, I have very descent performance now. The only remaining issue is the 50Hz cap , I don’t know how to get the 100Hz.

I also mentionned that I had no issue with my laptop which also have a dual GPU (optimus?) Intel/Nvidia.
That may be the source of the laptop confusion :slight_smile:

I give many details just in case anyone else has the same problem, he might find a solution here.
I spent a lot of time on Google/Forums for my problem, and nowhere I read about this bios switch to make my GPU kind of primary.

Maybe check the monitor settings in nvidia-settings. The driver may be getting in your way there.

I already checked nvidia-settings and I have the same info before and after switching the BIOS.

To be honest I don’t have much info in nvidia-settings




Could you try on Xorg instead of Wayland? The nvidia-settings panel has way more options on Xorg

Very interesting @Solene

When I tried to switch to xorg when I did not deactivated my Intel GPU, Xorg did not even started … (or crashed really soon)

Now that I disabled the Intel GPU, Xorg runs well.

You’re right, I get more information in nvidia-settings:

Peek 01-12-2023 14-45

But I get the 50Hz cap also (you can’t see it in the next capture, but I only have 50Hz in the menu.

Maybe it is a limitation of the graphic card, I couldn’t find the detailled specs, but I think I chose this model for the fanless first, and the resolution/framerate.

xrandr now shows more framerates, but not for my resolution…

$ xrandr
Screen 0: minimum 8 x 8, current 3440 x 1440, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected primary 3440x1440+0+0 (normal left inverted right x axis y axis) 797mm x 334mm
   3440x1440     49.99*+
   2560x1080     60.00    59.94  
   1920x1080     60.00    59.94    50.00    60.00    50.04  
   1680x1050     59.95  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x800      59.81  
   1280x720     100.00    60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  

If there are no performance difference (because the global desktop experience is as good), would you advise me to use Wayland or Xorg with NixOS 23.10 ?

My personal opinion: stick to whatever works the best, there are pros and cons for both X and Wayland.

Did you try to switch to HDMI? (use a hdmi 2.0 minimum cable)