Run Rviz from remote docker using X11

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
DEQDON
Gnoblar
Posts: 1
Joined: Sun Apr 19, 2020 3:27 am

Run Rviz from remote docker using X11

Post by DEQDON »

Original post is on https://stackoverflow.com/questions/612 ... -using-x11.

I'm planning to run ROS Rviz in a docker on a remote server, expecting the Rviz GUI to display on my local computer. But I cannot get it done. I know Rviz uses Ogre so I thought maybe this is the place where I can get help.

Please refer to the StackOverflow link above for detailed description.

So basically, I set many things up and I can run ```glxgears``` from the docker on the remote server and display the gears on my local computer. But when it comes to running Rviz, it throws an exception regarding Ogre:

Code: Select all

root@node3:/# rviz
[ INFO] [1587175060.603895335]: rviz version 1.13.7
[ INFO] [1587175060.603985593]: compiled against Qt version 5.9.5
[ INFO] [1587175060.604014712]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1587175060.620394536]: Forcing OpenGl version 0.
[ WARN] [1587175068.907551767]: OGRE EXCEPTION(3:RenderingAPIException): Couldn`t open X display :11 in GLXGLSupport::getXDisplay at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp (line 832)
terminate called after throwing an instance of 'Ogre::RenderingAPIException'
  what():  OGRE EXCEPTION(3:RenderingAPIException): Couldn`t open X display :11 in GLXGLSupport::getXDisplay at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp (line 832)
Aborted (core dumped)
Then I narrowed the question down to Ogre. I followed the exception to the source code of Ogre. In https://github.com/ehsan/ogre/blob/069a ... t.cpp#L831, it seems mXDisplay = XOpenDisplay(displayString); is wrong. Then I searched the manual of XOpenDisplay in https://tronche.com/gui/x/xlib/display/opening.html, and the ":11" display value seems fine.

Since X11 forwarding seems to be working fine (glxgears are good), now I'm really confused. Please help me! Thanks!
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: Run Rviz from remote docker using X11

Post by paroj »

thats an unsupported version of ogre you got there. Also I have no idea how Qt interferes with the window creation.

Please verify whether this snap exhibits the same issue: https://snapcraft.io/ogre
DEQDON
Gnoblar
Posts: 1
Joined: Sun Apr 19, 2020 3:27 am

Re: Run Rviz from remote docker using X11

Post by DEQDON »

paroj wrote: Sun Apr 19, 2020 1:15 pm thats an unsupported version of ogre you got there. Also I have no idea how Qt interferes with the window creation.

Please verify whether this snap exhibits the same issue: https://snapcraft.io/ogre
Thanks! I will try it these days! But not today... The remote server happens to have a network connection issue...

Still, there's something more of the Rviz output I can provide. I used ```rviz -l``` to see a more detailed log of ogre, and it prints the following:

Code: Select all

root@node3:/# rviz -l
[ INFO] [1587347751.258891748]: rviz version 1.13.7
[ INFO] [1587347751.258989828]: compiled against Qt version 5.9.5
[ INFO] [1587347751.259017887]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1587347751.275505230]: Forcing OpenGl version 0.
[ INFO] [1587347759.275606785]: Creating resource group General
[ INFO] [1587347759.275772220]: Creating resource group Internal
[ INFO] [1587347759.275827057]: Creating resource group Autodetect
[ INFO] [1587347759.276008321]: SceneManagerFactory for type 'DefaultSceneManager' registered.
[ INFO] [1587347759.276363754]: Registering ResourceManager for type Material
[ INFO] [1587347759.276450744]: Registering ResourceManager for type Mesh
[ INFO] [1587347759.276496732]: Registering ResourceManager for type Skeleton
[ INFO] [1587347759.276568910]: MovableObjectFactory for type 'ParticleSystem' registered.
[ INFO] [1587347759.276710912]: ArchiveFactory for archive type FileSystem registered.
[ INFO] [1587347759.276763885]: ArchiveFactory for archive type Zip registered.
[ INFO] [1587347759.276804855]: ArchiveFactory for archive type EmbeddedZip registered.
[ INFO] [1587347759.276845754]: DDS codec registering
[ INFO] [1587347759.276907600]: FreeImage version: 3.17.0
[ INFO] [1587347759.276976277]: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
[ INFO] [1587347759.277227300]: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,rgb,rgba,bw,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti,x3f,webp,jxr,wdp,hdp
[ INFO] [1587347759.277281552]: PVRTC codec registering
[ INFO] [1587347759.277328249]: ETC codec registering
[ INFO] [1587347759.277375109]: Registering ResourceManager for type HighLevelGpuProgram
[ INFO] [1587347759.277431131]: Registering ResourceManager for type Compositor
[ INFO] [1587347759.277751329]: MovableObjectFactory for type 'Entity' registered.
[ INFO] [1587347759.277809988]: MovableObjectFactory for type 'Light' registered.
[ INFO] [1587347759.277851605]: MovableObjectFactory for type 'BillboardSet' registered.
[ INFO] [1587347759.277889137]: MovableObjectFactory for type 'ManualObject' registered.
[ INFO] [1587347759.278534513]: MovableObjectFactory for type 'BillboardChain' registered.
[ INFO] [1587347759.278601740]: MovableObjectFactory for type 'RibbonTrail' registered.
[ INFO] [1587347759.278805687]: *-*-* OGRE Initialising
[ INFO] [1587347759.278855134]: *-*-* Version 1.9.0 (Ghadamon)
[ INFO] [1587347759.278941999]: OverlayElementFactory for type Panel registered.
[ INFO] [1587347759.278988559]: OverlayElementFactory for type BorderPanel registered.
[ INFO] [1587347759.279029257]: OverlayElementFactory for type TextArea registered.
[ INFO] [1587347759.279081768]: Registering ResourceManager for type Font
[ INFO] [1587347759.279140706]: Loading library /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL
[ INFO] [1587347759.283308157]: Installing plugin: GL RenderSystem
[ INFO] [1587347759.283418942]: OpenGL Rendering Subsystem created.
[ WARN] [1587347759.566593524]: OGRE EXCEPTION(3:RenderingAPIException): Couldn`t open X display :11 in GLXGLSupport::getXDisplay at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp (line 832)
terminate called after throwing an instance of 'Ogre::RenderingAPIException'
  what():  OGRE EXCEPTION(3:RenderingAPIException): Couldn`t open X display :11 in GLXGLSupport::getXDisplay at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp (line 832)
Aborted (core dumped)
Last edited by DEQDON on Mon Apr 20, 2020 3:17 am, edited 2 times in total.
DEQDON
Gnoblar
Posts: 1
Joined: Sun Apr 19, 2020 3:27 am

Re: Run Rviz from remote docker using X11

Post by DEQDON »

I tried to install the snap in the docker. This is a story where I failed again :( .

When doing ```snap install ogre```, it has the following error:

Code: Select all

error: cannot communicate with server: Post http://localhost/v2/snaps/ogre: dial unix /run/snapd.socket: connect: no such file or directory
So I tried to look at snap status using ```systemctl status snapd.service```, and to enable ```systemctl``` in docker, I followed https://forums.docker.com/t/systemctl-s ... er/9075/17.

Now in the docker, it shows

Code: Select all

System has not been booted with systemd as init system (PID 1). Can't operate.
I guess I cannot install the snap application according to https://snapcraft.io/ogre. I might try building the application from source some other day. But before that, do you have any other suggestions regarding the original ogre exception of Rviz?
Last edited by DEQDON on Mon Apr 20, 2020 4:33 am, edited 1 time in total.
Post Reply