Working with the MIT-SHM X11 extension on Linux

7,754

You cannot use MIT-SHM from a remote X11 client.

Just think about its acronym: SHM = shared memory. If the client and the server are running on different machines, that cannot share memory.

That extension is supposed to speed up X11 requests which are transferring a lot of data by using the SySV shared memory API instead of writing it through a socket (eg. XPutImage -> XShmPutImage). Its benefits on modern computers are discutable IMHO.

Share:
7,754
A_A
Author by

A_A

Mostly Harmless...

Updated on September 18, 2022

Comments

  • A_A
    A_A over 1 year

    I am trying to get Blender to work over a setup where Blender itself runs on a remote machine and its UI is presented to a local machine via X11.

    Detailed information about that is available here.

    This seems to be a frequently required use case and Blender itself will work, through the blender-softwaregl executable that is provided along the zip archive download option from blender.org but only up to version 2.79.

    On version 2.80, the same executable seems to be trying to setup a shared memory "object" which requires the MIT-SHM X11 extension.

    Specifically, Blender's executable complains (in the remote machine terminal) with: error code: 159, request code: 143, minor code: 34, error text: 159 and finally concludes with:

    Xlib: extension "MIT-SHM" missing on display "localhost:10.0".

    After this, the X11 window on the local machine remains open, as if the software runs without problems but displays nothing of Blender's GUI.

    At the same time, as the mouse gets dragged along the local X11 window, the remote terminal still produces XLib: extension "MIT-SHM"... errors.

    I have tried to find out more information about working with the MIT-SHM (installing, configuring, enabling / disabling, etc) but apart from this, this and this passing reference I have not had much luck.

    While I am still working on this, I would appreciate anyone's help with the MIT-SHM as I suspect that Blender is not the only piece of software that might make use of it. It seems like a cool X11 feature but I do not think that I have full control over it on my Ubuntu bionic 18.04 that runs on the server of my setup.

    1. How can I enable the MIT-SHM so that it shows up in the xdpyinfo listing?
    2. Is there a specific set of libraries I should have installed for it to fully work?
    3. Is there anything else that is implied by its use? (For example, do I need any extra ports enabled for this functionality to work?)
  • A_A
    A_A almost 5 years
    Thank you. I thought about something going on with regards to the client but the message is generated on the remote server side and it reports that the extension is missing on display localhost:10.0. My understanding is that this MIT-SHM is something that goes on between Blender and X11 at server side. X11 clients are pretty "thin". All they do is exchange messages and render patches that the server sends. What would your recommendation be for enabling it on a system? I understand it might not be the best thing ever.
  • mosvy
    mosvy almost 5 years
    You don't believe me, right? Let's give it another try: when you're forwarding your local display over ssh, the Xorg running on the local display (on the ssh client) is the X11 server and the program running on the remove machine (blender, on the ssh server) is the X11 client. Since they're running on separate machines, they cannot share memory, and they cannot use MIT-SHM. Forcing the X11 server to tell that it supports MIT-SHM will not help -- we're not in Wile E. Coyote vs. RoadRunner where simply drawing a tunner entrance on the mountain side will cause a train to come through it.