Render performance significantly worse on Linux?

Ninbura

New Member
I've been serving applications out of WSL on Windows, but recently jumped to Ubuntu proper (23.10) after clearing a few technical hurdles I couldn't solve on LInux in the past. I use OBS on this machine in combination with Advanced Scene Switcher & NDI to share my displays in collaborative sysadmin / software development sessions with my peers.

When I got around to configurating OBS, I noticed that my "Average time to render frame" is about 4x higher than what it was running Windows (9-10ms vs 2ms). Same computer/hardware, screen capture source of the same 4K display. I installed OBS through Flatpak, and gave it the "GPU acceleration" permission via Flatseal. But just to make sure it wasn't a sandboxing issue, I also tried installing OBS through Ubuntu's "Software" application with the "deb" version selected. Performance is identical regardless of how I install it. I've also verefied that my GPU driver is installed and working, as well as trying multiple versions of said driver.

I'm using the XSHM screen capture option over PipeWire, as PipeWire gets confused about having 2 displays with the same EDID connected. But also, my average time to ro render frames with a PipeWire screen capture source of a 4K display is over 50ms. Where-as with XSHM it hovers between 9 & 10ms at idle, but jumps up into the mid-teens as I use the computer.

Is there anything I can change to decrease the average time to render frames? I'm not dropping so many frames that the output is unusable, but far more than I was on Windows. I didn't have the foresight to collect logs when I was running Windows, but I've attached one for what's currently happening on Ubuntu.

relevant system specs
  • operating system - Ubuntu 23.10
  • cpu - AMD Threadripper 2970WX
  • gpu - RTX 4070 Ti (nvidia-driver-545)
  • ram - 128GB DDR4 @ 3200Mhz
relevant obs info
  • version - 30.0.2 (64 bit)
  • base/output canvas - 1920x1080
  • framerate - 60
 

Attachments

  • 2024-02-12 15-42-54.txt
    21.8 KB · Views: 18

Tuna

Member
- XSHM screen capture is known to be slow.
- For nvidia the fastest method was nvFBC, but is defunct in latest OBS versions.
- If pipewire is too slow it probably does not use texture sharing. I would try Wayland over X11. But it depends very much on your Wayland compositor and gpu driver.
 

Ninbura

New Member
With an Nvidia GPU it seems like Wayland isn't quite there yet. I also use Synergy for sharing my mouse and keyboard between computers, and they don't have Wayland support quite yet.

Sound like compatibility is just around the corner for both Nvidia & Synergy. My guess is I'll be able to test if my rendering server is the problem some time this year.
 

Metal3d

New Member
On Fedora 39, it's absolutely hellish. Gnome + Wayland, I try to record a video by sharing the Blender window. Everything starts to lag. Blender becomes slow, the output video stream is around 15 frames per second, it's horrible.

But you have to realize that OBS isn't the only one to suffer, kitty-term has cursor jumps, Brave starts flashing during scrolling, etc.

It seems to be the NVidia driver that's causing the problem. I have an RTX 3070 (direct card, on a desktop) and I'm angry to see such a visual massacre.

I've tried using Gnome on Xorg, and it's far less terrible. Except that the window capture (with pipewire) turns black in the stream / recording... So it's unusable for me.

What I'm wondering about is that I find myself in a very complicated situation: I absolutely must record tutorials, and it's currently impossible. I'm going to try GStreamer command lines, but it's not as interesting as using OBS (I love it).

So, to sum up, the problem must lie with NVidia + Wayland, and not with OBS... at least as I understand it.
 

Ninbura

New Member
On Fedora 39, it's absolutely hellish. Gnome + Wayland, I try to record a video by sharing the Blender window. Everything starts to lag. Blender becomes slow, the output video stream is around 15 frames per second, it's horrible.

But you have to realize that OBS isn't the only one to suffer, kitty-term has cursor jumps, Brave starts flashing during scrolling, etc.

It seems to be the NVidia driver that's causing the problem. I have an RTX 3070 (direct card, on a desktop) and I'm angry to see such a visual massacre.

I've tried using Gnome on Xorg, and it's far less terrible. Except that the window capture (with pipewire) turns black in the stream / recording... So it's unusable for me.

What I'm wondering about is that I find myself in a very complicated situation: I absolutely must record tutorials, and it's currently impossible. I'm going to try GStreamer command lines, but it's not as interesting as using OBS (I love it).

So, to sum up, the problem must lie with NVidia + Wayland, and not with OBS... at least as I understand it.
Obviously not free, but I'd be interested to hear if a capture card is more performant than display capture. On Windows this is basically redundant, but with how screen cap performance is on Linux, it could be highly preferable.
 

Metal3d

New Member
So I just went back to Xorg to make sure I hadn't made a mistake. And I did... Using Xcomposite to capture a window, in 4K, with my camera overlay, there's no problem.

This means that, clearly, Wayland is the source of the problem if, and only if, the NVidia card is the main card (on my laptop, the problem doesn't appear. The card is dedicated to calculations and rendering, not to desktop display).

Wayland is really causing too many problems, I wonder if it's not too soon to have put it into production. Between client-side rendering problems, lags with NVidia, capture problems with OBS and the power required for every application that uses OpenGL / Vulkan for a refresh, I wonder where we're going.

NVidia is aware of these concerns (if I'm to believe what I see on their forums), but no improvement has been seen for months. Personally, I'm starting to wonder whether I should look into Radeon. What bothers me is that I'm doing machine learning and I'm obviously being forced to use CUDA... While OpenCL could have been a great universal solution, once again it's proprietary software that dictates the rules and, in the end, causes us unsolvable problems.

Sorry for this message of spite, I had to express my anger :)

EDIT: So, at this time, I use Xorg. Old, but working.
 
Top