I’ve got a problem with tearing and I don’t know how to disable it. Usually it’s done by setting ForceCompositionPipeline=On but that’s not working here, as CurrentMetaMode is NULL (the nvidia GPU is set as primary device):
303 frames in 5.0 seconds = 60.542 FPS
300 frames in 5.0 seconds = 59.937 FPS
300 frames in 5.0 seconds = 59.931 FPS
nvidia-smi says:
# nvidia-smi
Mon Feb 7 17:45:50 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01 Driver Version: 470.103.01 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A |
| N/A 38C P8 4W / N/A | 10MiB / 3911MiB | 10% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 18156 G /usr/bin/X 6MiB |
| 0 N/A N/A 20006 G glxgears 2MiB |
+-----------------------------------------------------------------------------+
Ok, glxgears uses nvidia gpu. I tested the same with firefox and run tearing test in Youtube - worked fine. But there is an error when starting e.g. Thunderbird, because it want’s to have nouveau_dri.so:
MESA-LOADER: failed to open nouveau: /usr/lib64/dri/nouveau_dri.so
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to create EGLSurface!: 0x3009 (t=2.49448) [GFX1-]: Failed to create EGLSurface!: 0x3009
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to create EGLSurface!: 0x3009 (t=2.49448) |[1][GFX1-]: Failed to create EGLSurface (t=2.49454) [GFX1-]: Failed to create EGLSurface
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Failed to create EGLSurface!: 0x3009 (t=2.49448) |[1][GFX1-]: Failed to create EGLSurface (t=2.49454) |[2][GFX1-]: Fallback WR to SW-WR (t=2.51412) [GFX1-]: Fallback WR to SW-WR
IPDL protocol error: Handler returned error code!
How can I ensure, that the correct driver get’s loaded?
Some more info for offload mode:
~> xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1920x1080 59.93*+ 39.99
1680x1050 59.93
1280x1024 59.93
1440x900 59.93
1280x800 59.93
1280x720 59.93
1024x768 59.93
800x600 59.93
640x480 59.93
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
Seems that on prime-select nvidia mode the driver doesn’t get the correct framerate because it doesn’t know enough about the screen? Is there a possibility to provide the necessary information to the driver?
If I delete 90-nvidia.conf I’m getting the pure amd interface / driver. But that’s not what I want.
Do you want to say, the only way to correctly use the nvidia GPU is the offload mode by using the above mentioned environment variables to force applications to use nvidia?
Section "ServerLayout"
Identifier "layout"
Screen "amd"
Option "AllowNVIDIAGPUScreens"
EndSection
Section "Device"
Identifier "amd"
Driver "modesetting"
BusID "PCI:5:0:0"
EndSection
Section "Screen"
Identifier "amd"
Device "amd"
EndSection
# needed for NVIDIA PRIME Render Offload
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1920x1080 59.93*+ 39.99
1680x1050 59.93
1280x1024 59.93
1440x900 59.93
1280x800 59.93
1280x720 59.93
1024x768 59.93
800x600 59.93
640x480 59.93
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
I tested the offload mode and realized, that mpv e.g. automatically uses nvidia - even w/o setting the above mentioned environment variables.
Update: That’s not completely true. mpv uses the nvidia-libraries - but not the nvidia device. If you really want to get the output via /dev/nvidia*, you have to use the environment variables.
I attached the Xorg.0.log for offload configuration. Xorg.0.log.gz (7.3 KB)
You don’t need to use offload mode for vsync, just the amdgpu driver instead of modesetting. You should just clean up your config files as this seems a bit messy.
Besides /etc/X11/xorg.conf.d/90-nvidia.conf you also have /etc/X11/xorg.conf.d/20-amdgpu.conf defining explicit “Section Device”. You can delete both and instead use /etc/X11/xorg.conf.d/10-nvidia-primary.conf
I followed your suggestion and it works perfectly! It’s much easier as expected - but that’s pretty often if you know what you’re doing … .
I “fixed” suse-prime 0.8.5 as attached in prime.tar.gz (it’s the directory in /usr/share/) and removed some historical config files in /etc/X11/xorg.conf.d/.
The xorg.conf.d.tar.gz contains the device specific configuration for amd only, nvidia only and offload mode after using prime-select amd | nvidia | offload.
A bit strange: starting firefox (96.0.1) in offload mode using the offload environment variables
Options like ForceCompositionPipeline and MetaModes only apply to displays directly connected to the nvidia gpu. The internal display of your laptop is connected to the amd gpu, so those options have no effect on that.
During tests I realized a problem regarding S2RAM / resume with Thunderbird (91.5.0) running nvidia PRIME. The Thunderbird window stays empty or black - or it contains the content of the overlaying window and can’t be refreshed after resume. Even minimizing it or changing the size of the window doesn’t solve the problem. I have to restart Thunderbird to get it working again. Is this a known problem?
Maybe kwin could trigger the problem - because on every resume (with nvidia graphics) I get a message like that, that the desktop effects would have been restarted.
The complete nvidia specific systemd configuration was laid out - but not activated. I activated those three services and added the NVreg_PreserveVideoMemoryAllocations=1 kernel module.
The “restarted desktop effects” notification disappeared - but the problem regarding Thunderbird didn’t change (surprisingly it worked 2 times). Therefore I started Thunderbird in konsole and got this Error:
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: GFX: RenderThread detected a device reset in PostUpdate (t=35.9602) [GFX1-]: GFX: RenderThread detected a device reset in PostUpdate
IPDL protocol error: Handler returned error code!
Maybe interesting: if you blindly click to a global menu entry (like file e.g.), the related pull down menu can be seen. You’re even getting a new mail window to write a new mail e.g.
KDE detects this problem, too, but obviously can handle the problem better.
Feb 08 17:18:53 notebook4 kglobalaccel5[19571]: Crash Annotation GraphicsCriticalError: |[0][GFX1-]: GFX: RenderThread detected a device reset in PostUpdate (t=95.777) [GFX1-]: GFX: RenderThread detected a device reset in PostUpdate
Feb 08 17:18:53 notebook4 kglobalaccel5[19510]: [GFX1-]: GFX: RenderThread detected a device reset in PostUpdate
Nvidias documentation recommends to use hibernate instead of sleep - but that doesn’t work on a “lockdowned” kernel.
Ok - not a big problem - but maybe there will be a solution some day.