G4OpenGLXViewer error in Red Hat Enterprise Linux Server release 6.9 (Santiago)

Dear G4 experts,

I’m experiencing some issues in running example B1 provided with geant4.10.05.p01. Please find below the error message I get when I launch the command ./exampleB1 from B1-build folder:

/vis/open OGL 600x600-0+0
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600x600-0+0
G4OpenGLXViewer::G4OpenGLXViewer: unable to get a single buffer visual.
G4OpenGLXViewer::G4OpenGLXViewer: unable to get a double buffer visual.
G4OpenGLXViewer::G4OpenGLXViewer: unable to get required visuals.
G4OpenGLStoredX::CreateViewer: error flagged by negative view id in G4OpenGLStoredXViewer creation.
Destroying view and returning null pointer.
ERROR in G4VisManager::CreateViewer: null pointer during OpenGLStoredX viewer creation.
No action taken.
WARNING: No viewer created.

I am pretty sure building and installation of the environment has been done correctly.

Could you please give me some suggestions to solve this issue?

Thanks in advance.

Regards,
Antonio

I’ve moved this to the Visualization forum as it looks like you have a running application, but visualisation is failing at runtime.

Hi Antonio

Looks like you might have some incompatible X11 libraries and fonts. This happened for me when I had inadvertently installed two versions of X11. Make sure you have a full, up to date and only one installation of X11. On my Mac, all X11 libraries and fonts are under /usr/X11/. For example the fonts are in /usr/X11/lib/X11/fonts. (Actually they are in /opt/X11 and the above are symbolic links.)

Hope this helps.

John

Hi John,
thank you for your feedback.
I had a look at my X11 libraries and fonts installation folder.
Under /usr/, I found a X11R6 folder containing just a symbolic link to /usr/share/X11/fonts/.
Then, under /usr/include/X11, I have a bunch of .h files and additional folders (/bitmaps, /dri, /extensions, /fonts, /ICE, /PM, /SM, /Xaw, /Xcursor, /Xft, /Xmu).
Finally, I found another X11 folder under /usr/share containing additional subfolders.
When building G4, I got: – Found X11: /usr/include
Do you think the issue could be related to the presence of both X11 and X11R6?
If yes, is there a way to force the build to look only at a specific X11 installation folder without removing the other one?

Thank you very much for your help.

Regards,
Antonio

Hi Antonio

Mmm. What machine are you using? Where did you get X11 from?

Here are the relevant links on my machine:

~ ll /usr/X11* lrwxr-xr-x 1 root wheel 25 May 29 00:07 /usr/X11@ -> ../private/var/select/X11 lrwxr-xr-x 1 root wheel 25 May 29 00:07 /usr/X11R6@ -> ../private/var/select/X11 ~ ll /private/var/select/X11*
lrwxr-xr-x 1 root wheel 8 Dec 9 2019 /private/var/select/X11@ -> /opt/X11

I don’t have /usr/include. On my machine

– Found X11: /usr/X11/include

Every system is different. The important thing is that it’s clean. Maybe a reinstallation would help.

In answer to your other queries…

X11 and X11R6 are usually synonymous, as above.

Yes, you can direct cmake to look in specific places. It’s messy. There are lots of options that you can set with -D. If you type ccmake . in the build directory you will see them (hit t for toggle).

Hope you make progress.

John

Hi John,

actually, my scripts are running on a remote machine (Red Hat Enterprise Linux Server) to which I have access through a VNC session opened on my local machine. So this could be one issue. In addition, from your links, I notice they are all pointing to the same folder and this is not my case. Unfortunately, I cannot uninstall those libraries I find on the remote machine. Nevertheless, I could try to play with CMAKE options to force the paths. Your suggestion of how options can be shown will be very useful for that.

Thank you for your help.

Regards,
Antonio

Ah. “this could be one issue” - probably is the issue. Your local machine has to be properly configured with an X server. Is it a Windows machine? I’m not familiar with Windows, nor with VNC as a way of connecting. (If anyone does, please join this Forum exchange.) You have to install an X server on your local machine and make sure the GLX extension is activated. Then, when you connect to the remote machine you have to enable an X connection. On my Unix local machine, I open a terminal and type ssh -Y <user@a.b.c>.

Can you run xdpyinfo on your local machine? This is what it gives for me

name of display: /private/tmp/com.apple.launchd.gDVulNLEfA/org.macosforge.xquartz:0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11804000
X.Org version: 1.18.4
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 4, bits_per_pixel 8, scanline_pad 32
depth 8, bits_per_pixel 8, scanline_pad 32
depth 15, bits_per_pixel 16, scanline_pad 32
depth 16, bits_per_pixel 16, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
depth 32, bits_per_pixel 32, scanline_pad 32
keycode range: minimum 8, maximum 255
focus: window 0x60000d, revert to None
number of extensions: 23
Apple-DRI
Apple-WM
BIG-REQUESTS
DAMAGE
DOUBLE-BUFFER
GLX

number of visuals: 128
default visual id: 0x22
visual:
visual id: 0x22
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits

and pages and pages of more visuals.

Hope this helps.

John

Hi John,

finally, I was able to find the issue. The problem was related to the visual attributes list passed to the glxChooseVisual function in the G4OpenGLXViewer.cc script. In my case in fact, only visuals with no stencil buffer are available from remote machines (as I found by running the glxinfo command) so GLX_STENCIL_SIZE needs to be set to 0 in G4OpenGLXViewer.cc.
Hope this may be useful also to other users experiencing similar issues.
Once again, thank you for your suggestions.

Regards,
Antonio

OK, Antonio. Thanks for digging into this.

I am surprised your systems do not support an OpenGL stencil buffer. Geant4 has been using it since 2004. As a matter of interest, is this a limitation of your local X server or the remote X client?

Anyway, thankyou. It will indeed be useful for users experiencing similar issues.

John

Unfortunately, this is an information that I do not have right now actually.

Regards,
Antonio