10

I'm running a computer vision model on a headless remote VM (Ubuntu 16.04) over X11Forwarding with good ol' Putty and Xming as my Windows X Server.

All is well but seems there is no frame drop if the client-server bandwidth can't keep up, which means my application is slowed down and only renders a few frames a second when it can do hundreds if bandwidth is plenty.

Is there a force frame drop option built into X11 forwarding, and if there is, how do i turn it on?

evilSnobu
  • 288
  • 1
  • 9
  • 5
    The X11 protocol does not have a notion of frames, and hence does not support frame dropping (i.e. there is no resynchronisation point). – Simon Richter Sep 12 '18 at 13:29

3 Answers3

11

I highly recommend Xpra for this sort of use-case: not only does it provide the ability to disconnect and reconnect to X applications running on a remote host, it also supports a variety of image encodings to provide a decent experience in different circumstances, can accelerate OpenGL applications and use OpenGL in the client for better performance.

It has a native Windows client so it should be easy enough to set up. You’ll need to install it on the remote VM too, but that’s as easy as apt install xpra on Ubuntu.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • By default, Xpra seems no better than plain x11 forwarding (on slow connections). I'm trying to discover how to optimize it. The links in your answer are now broken, so I'm now looking for the "image encodings" and "window refresh settings" you mention. – Lonnie Best Oct 13 '22 at 18:37
  • 1
    Thanks @LonnieBest, I’ve updated the answer to match current versions of Xpra and the new website layout. – Stephen Kitt Oct 13 '22 at 20:59
4

According to this related question, looks like X11Forwarding isn't the best option for graphics intesive applications, as the X11 protocol wasn't designed with bitmap drawing performance in mind.

It basically sends drawing instructions to the network, which is "all good" if we're talking about a couple of windows with text, but it's obviously overkill for millions of pixels changing every frame, expecially when network experiences high latency/jitter/packet loss.

As suggested in the answer to the question mentioned, you could try x2go and see if it fits your needs.

EDIT as per comment

If x2go won't do, you can try VNC which looks like has frame dropping capabilities. For example, I use x11vnc for connecting to my desktop from a remote connection with x11vnc -display :0 -auth .Xauthority which hooks to my display.

Don't know if it would work with Xming but you can give it a try.

Daniele Santi
  • 4,127
  • 2
  • 29
  • 30
2

The pure X11 protocol does not lend well itself for guaranteeing transmission, and much over SSH.

I recommend NoMachine. It can do bandwidth compression and network optimization. It also has clients for Mac, Windows and Linux.

PS. NoMachine has the free and the paid versions. I always used the free.

See NoMachine

For virtual desktops (case a) the X11 vector graphics mode (previously known as “lightweight” mode) is enabled by default. This method reduces the bandwidth usage (and the HW requirements because is less CPU intensive) on both client and server by optimizing the X11 protocol by means of compression techniques, round trip suppression and cache algorithms.

The X11 vector graphics mode is convenient to avoid loss of image quality and can be useful when working with traditional GUIs or large amount of text, but it's not suggested for multimedia contents or applications with many graphical effects.

More about the X11 vector graphics mode: https://www.nomachine.com/AR02L00779

For connections to the physical desktop or when the X11 vector graphics mode is disabled for virtual desktops (case b) NoMachine implements the display protocol using a combination of video and image encoding based on standard codecs and a number of techniques developed by NoMachine itself.

It also implements a network adaptive display quality technique. This means that NoMachine will automatically try to reduce the display quality when it detects that the network is congested. Purpose of this mechanism is to keep the session responsive through all the different network conditions.

More about finding the most suitable configuration for multimedia playing:

https://www.nomachine.com/AR01M00832

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
  • 1
    Is that "Free as in closed-source advertisement for our paid option" or "Free as in Stallman"? – pipe Sep 12 '18 at 13:47
  • @pipe Somewhere in the middle, I think. I have used the free version for personal use it with much satisfaction, I also was laterally involved and know of big projects that used the free version. The paid version can apparently save some trouble customizing things around in more complex environments from what more experienced people told me. – Rui F Ribeiro Sep 12 '18 at 14:14