16

When ssh'ing in to a remote system (such as a cluster with substantial compute power and/or graphics harware) with X11 forwarding (eg, using ssh -X or -Y), where is the graphics rendering done? How would you run a graphics-intensive workload in such a way that it took advantage of the cluster's graphics hardware? And does running the program in a VM on the cluster complicate matters?

Jonathan Dursi
  • 50,107
  • 9
  • 127
  • 158
aze
  • 832
  • 4
  • 12
  • 34
  • 1
    Before i could post this thing i met the error about quality standards and ended posting an empty code string, sorry about that . – aze Jul 04 '14 at 14:59
  • 1
    ok well you still downvoted my question without reading the comment... thanks a lot @Joe – aze Jul 04 '14 at 15:04
  • I don't know what an IBM calculator is or how any part of your question is a programming question that's relevant for this site or any other in the SE network. – Joe Jul 04 '14 at 15:07
  • 1
    @Joe Ho thanks for actually providing relevant information about my post and your opnion, where should i go to post this then ? (by IBM calculator i just meant IBM computer) – aze Jul 04 '14 at 15:09

1 Answers1

12

In X11 rendering always happens on the X11 server side, i.e. on the system that the display server is running on.

How would you run a graphics-intensive workload in such a way that it took advantage of the cluster's graphics hardware?

By running the X11 server on the clusters' systems and only redirect the output to the display system. There are several projects implementing this: VirtualGL and Chromium to name two.

However my personal favorite is using Xpra with a X server that utilzes the GPU. However the unfortunate drawback is, that with Xorg's current driver model you can not share the GPU between X servers. Yes you can run multiple X servers at the same time, but only one can make use of the GPU at any time.

Also keep in mind, that clustered GPU rendering is not easily done. So far NVidia is the only GPU vendor to provide a turnkey remote cluster rendering solution.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • If i understood well, when using ssh, forwarding X11 means sending the rendering instructions to the client X11 server ? using a VM on linux can i use Xpra ? – aze Jul 05 '14 at 10:11
  • @user3714670: Yes, that's the point of X forwarding: The rendering commands are ultimately sent to the system the X server runs on. However be advised that many "modern" toolkits, for some dubious reasons, chose to perform rendering themself and only transfer the finished picture. This is inefficient on itself, but add to the fact that trasferring large bitmaps, uncompressed doesn't help with low bandwidth consumption this is a big problem. X11 over networks can be very performant if the clients are not written by lobotomized monkeys (there, my opinion of "modern" tookit writers is out). – datenwolf Jul 05 '14 at 12:43
  • @user3714670: It's no problem at all to use Xpra with VMs. The much bigger problem though will be, that it's very difficult, if not impossible to give VMs access to the host system's GPU. So if you're running a system in a VM, hosted on a system with a capable GPU, then regular X forwarding will actually be the preferrable choice. However I strongly suggest not to use SSH X forwarding then, but to open a unencrypted X over TCP channel. If your VM has a virtio channel for networking to the host system this adds acceptable little overhead. GLX indirect rendering is supported up to OpenGL-2.1 – datenwolf Jul 05 '14 at 12:46
  • @user3714670: OpenGL-3 and later are actually much better suited for indirect rendering (everything goes though buffer objects in modern OpenGL which is essentially indirect rendering all the way down), but the GLX protocol has not been brought up to OpenGL-3 support yet, which is a shame. – datenwolf Jul 05 '14 at 12:47
  • I would like to ask questions about VMs (is it the best way to play on linux considering indirect rendering), should i do it there or should i open a new thread ? Thanks for all the good information i wish everyone was like you on SO. – aze Jul 07 '14 at 08:01
  • @user3714670: A new question would be in order (I'd call it "semantics of GLX indirect rendering and using it with VMs" or something like that). But the short gist is: If your host operating system has a X11 that offers GPU accelererated OpenGL, then putting Linux into a VM is the way to go. Unfortunately OpenGL GPU acceleration is properly implemented only in the "native" Xorg X11 server running on Linux and the *BSDs; there are other X11 servers (some also based on Xorg), but those usually don't have full accelerated OpenGL support. – datenwolf Jul 07 '14 at 08:40
  • @user3714670: If you're running a VM on a Windows host, then you're kind of out of luck, because the OpenGL support of Xming and Cygwin X are only rudimentary and GPU "pass through" support is even more lacking, so far. On MacOS X the situation is a bit better, because a OpenGL capable X server exists (even used to be part of the default installation in past years). – datenwolf Jul 07 '14 at 08:43
  • Actually i want to achieve the opposite, the OS installed is Linux redhat (i can't change it) and i am putting windows in a VM to play using DirectX (i havent even tried it yet) and want to forward the video output through my connection. – aze Jul 07 '14 at 09:25
  • @user3714670: Unfortunately with the current driver model of Linux this is not (yet) possible. The X server holds a firm grip on the GPU and OpenGL is the only API for accelerated GPU access. Technically you could run programs using the X protocol on the Windows guest and pass through the GLX stream to your host's X server. But DirectX simply won't work with this. You can't even use something like `togl` for this, because you'd need the program to open a connection to the X server first. Future Linux GPU driver modells will allow to pass through a virtualized GPU to the host; not there yet. – datenwolf Jul 07 '14 at 09:30