No Geometry simulated (ExampleB1)

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:geant4-11-02-patch-02
_Operating System:WSL (Ubuntu 22.04.3 LTS)
_Compiler/Version:gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
_CMake Version:cmake version 3.22.1

Hi, I am trying to install Geant4, then later GATE on WSL. The installation process went well but when I tried to run the Example B1 simulations, the GUI opens but no geometry was simulated with only the black background. Attached below is the output on the terminal:

Available UI session types: [ Qt, tcsh, csh ]

**************************************************************
 Geant4 version Name: geant4-11-02-patch-02    (21-June-2024)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

<<< Reference Physics List QBBC 
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Registered graphics systems are:
  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML2FILE (VRML2FILE)
  gMocrenFile (gMocrenFile)
  TOOLSSG_OFFSCREEN (TSG_OFFSCREEN)
  TOOLSSG_OFFSCREEN (TSG_OFFSCREEN, TSG_FILE)
  OpenGLImmediateQt (OGLIQt, OGLI)
  OpenGLStoredQt (OGLSQt, OGL, OGLS)
  RayTracerX (RayTracerX)
  TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
  TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
Default graphics system is: OGL (based on build flags).
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
Note: Parameters specified on the command line will override these defaults.
      Use "vis/open" without parameters to get these defaults.

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByAttribute
  drawByCharge
  drawByOriginVolume
  drawByParticleID
  drawByEncounteredVolume

Registered models:
  None

Registered filter factories:
  attributeFilter
  chargeFilter
  originVolumeFilter
  particleFilter
  encounteredVolumeFilter

Registered filters:
  None

You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
/control/saveHistory
/run/verbose 2
#
# Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize
userDetector->Construct() start.
Checking overlaps for volume Envelope:0 (G4Box) ... OK! 
Checking overlaps for volume Shape1:0 (G4Cons) ... OK! 
Checking overlaps for volume Shape2:0 (G4Trd) ... OK! 
World is registered to the default region.
physicsList->Construct() start.
### HadronInelasticQBBC Construct Process:
    Emin(FTFP)= 3 GeV; Emax(FTFP)= 100000 GeV
    Emin(BERT)= 1 GeV; Emax(BERT)= 6 GeV; Emax(BERTpions)= 12 GeV;
    Emin(BIC) = 0 GeV; Emax(BIC)= 1.5 GeV.
physicsList->CheckParticleList() start.
physicsList->setCut() start.
#
# Visualization setting
/control/execute vis.mac
# Macro file for the visualization setting in the initialization phase
# of the B1 example when running in interactive mode
#
# Specify a viewer, e.g., /vis/open OGL, or allow a system choice:
/vis/open
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600x600-0+0
/vis/viewer/refresh
# This chooses a graphics system (in order of priority):
# - by argument in G4VisExecutive construction.
# - by environment variable, G4VIS_DEFAULT_DRIVER.
# - by information in ~/.g4session.
# - by mode (batch/interactive) and if interactive, by your build flags.
# See "Choosing a graphics viewer" in the Application Guide for details.
# For example, with environment variable G4VIS_DEFAULT_DRIVER:
#   The format is <graphics-system> [<window-size-hint>]. Set this, e.g:
#     (bash) export G4VIS_DEFAULT_DRIVER=TSG
#     (tcsh) setenv G4VIS_DEFAULT_DRIVER OI
#   or on the command line, precede the app invocation, e.g:
#     G4VIS_DEFAULT_DRIVER=Vtk ./<application-name>
#   The window-size-hint can optionally be added, e.g:
#     (bash) export G4VIS_DEFAULT_DRIVER="OGLSX 1000x1000-0+0"
# Other suggestions for G4VIS_DEFAULT_DRIVER (see list of registered
# graphics systems printed at the start):
#     DAWNFILE: to create a .prim file suitable for viewing in DAWN.
#     HepRepFile: to create a .heprep file suitable for viewing in HepRApp.
#     VRML2FILE: to create a .wrl file suitable for viewing in a VRML viewer.
#     "TSG_OFFSCREEN 1200x1200": to create an image file with TSG.
#       See the tsg_offscreen.mac in examples/basic/B5 for more commands
#       to change the file format, file name, picture size, etc.
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
Visualization verbosity changed to errors (2)
#
# Draw geometry:
/vis/drawVolume
/vis/scene/create
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0
/vis/sceneHandler/attach
#
# Specify view angle:
/vis/viewer/set/viewpointVector -1 0 0
/vis/viewer/set/lightsVector -1 0 0
#
# Specify style (surface, wireframe, auxiliary edges,...)
/vis/viewer/set/style wireframe
/vis/viewer/set/auxiliaryEdge true
/vis/viewer/set/lineSegmentsPerCircle 100
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/tracking/storeTrajectory 2
Attributes available for modeling and filtering with
  "/vis/modeling/trajectories/create/drawByAttribute" and
  "/vis/filtering/trajectories/create/attributeFilter" commands:
G4TrajectoriesModel:
  Event ID (EventID): G4int
  Run ID (RunID): G4int
G4SmoothTrajectory:
  Charge (Ch): unit: e+ (G4double)
  Track ID (ID): G4int
  Initial kinetic energy (IKE): G4BestUnit (G4double)
  Initial momentum magnitude (IMag): G4BestUnit (G4double)
  Initial momentum (IMom): G4BestUnit (G4ThreeVector)
  No. of points (NTP): G4int
  PDG Encoding (PDG): G4int
  Parent ID (PID): G4int
  Particle Name (PN): G4String
G4SmoothTrajectoryPoint:
  Auxiliary Point Position (Aux): G4BestUnit (G4ThreeVector)
  Step Position (Pos): G4BestUnit (G4ThreeVector)
/vis/scene/notifyHandlers
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/scene/notifyHandlers scene-0
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
/vis/scene/notifyHandlers scene-0
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true
# To select or override default colours (note: e+ is blue by default):
#/vis/modeling/trajectories/list
#/vis/modeling/trajectories/drawByParticleID-0/set e+ yellow
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
#
# Decorations
# Name
/vis/set/textColour green
/vis/set/textLayout right
/vis/scene/add/text2D 0.9 -.9 24 ! ! exampleB1
/vis/scene/notifyHandlers
# or, if your system does not support right-adjustment
#/vis/scene/add/text2D 0 -.9 24 ! ! exampleB1
/vis/set/textLayout
/vis/set/textColour
#
# Axes, scale, etc.
/vis/scene/add/scale
/vis/scene/notifyHandlers
/vis/scene/add/axes
/vis/scene/notifyHandlers
/vis/scene/add/eventID
/vis/scene/notifyHandlers
/vis/scene/add/date
/vis/scene/notifyHandlers
/vis/scene/add/logo2D
/vis/scene/notifyHandlers
/vis/scene/add/logo
/vis/scene/notifyHandlers
#
# Frame
/vis/set/colour red
/vis/set/lineWidth 2
/vis/scene/add/frame
/vis/scene/notifyHandlers
/vis/set/colour
/vis/set/lineWidth
#
# Attach text to one edge of Shape1, with a small, fixed offset
/vis/scene/add/text 0 6 -4 cm 18 4 4 Shape1
/vis/scene/notifyHandlers
# Attach text to one corner of Shape2, with a small, fixed offset
/vis/scene/add/text 6 7 10 cm 18 4 4 Shape2
/vis/scene/notifyHandlers
#
# To get nice view
# Make the "World" box invisible
/vis/geometry/set/visibility World 0 false
/vis/scene/notifyHandlers
# "Envelope" is transparent blue to represent water
/vis/geometry/set/colour Envelope 0 0 0 1 .3
/vis/scene/notifyHandlers
/vis/viewer/set/style surface
/vis/viewer/set/hiddenMarker true
/vis/viewer/set/viewpointThetaPhi 120 150
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/viewer/refresh
/vis/verbose warnings
Visualization verbosity changed to warnings (3)
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
 Changing export format to "jpg"

Any help is appreciated to solve this problem, thanks in advance!

Hi JSWong19

When you say, “No geometry simulated,” I am assuming you mean “No geometry displayed.” I think you will find that that particle tracking still works - try “/run/beamOn 100”, or similar.

Please check that you have the correct graphics card driver for your graphics card. Find out the type and model of your graphics card and Google the manufacturer for a driver. This often fixes the problem. WSL and Ubuntu seem particularly vulnerable to this problem.

I hope this fixes it for you
John

Hi, yes, no geometry was displayed. I downloaded the GPU and configured it, but now I cannot even run ./ExampleB1, the error is

./exampleB1: error while loading shared libraries: libG4graphics_reps.so: cannot open shared object file: No such file or directory

But the libG4graphics_reps.so file is in the installation folder…

Are you running exampleB1 directly from where you built it, or did you install it first (e.g. via make install)? In the first case, CMake will by default set the application up to find the Geant4 libs automatically. In the second, the geant4.sh script (in the bin directory under where Geant4 is installed) may need to be sourced to set up the LD_LIBRARY_PATH to point to the libraries.

I installed it first, I sourced the geant4.sh and make again in the exampleB1/build directory, now the aforementioned error is gone, and the command runs and stops at Segmentation fault (core dumped).

1 Like

Thanks, could you post the output up to the seg fault please, so we can see what point it’s happening at please? Have you modified the example code in any way?

No, I did not modify the example code, here is the output:

Available UI session types: [ Qt, tcsh, csh ]

**************************************************************
 Geant4 version Name: geant4-11-02-patch-02    (21-June-2024)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

<<< Reference Physics List QBBC 
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Registered graphics systems are:
  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML2FILE (VRML2FILE)
  gMocrenFile (gMocrenFile)
  TOOLSSG_OFFSCREEN (TSG_OFFSCREEN)
  TOOLSSG_OFFSCREEN (TSG_OFFSCREEN, TSG_FILE)
  OpenGLImmediateQt (OGLIQt, OGLI)
  OpenGLStoredQt (OGLSQt, OGL, OGLS)
  RayTracerX (RayTracerX)
  TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
  TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
Default graphics system is: OGL (based on build flags).
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
Note: Parameters specified on the command line will override these defaults.
      Use "vis/open" without parameters to get these defaults.

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByAttribute
  drawByCharge
  drawByOriginVolume
  drawByParticleID
  drawByEncounteredVolume

Registered models:
  None

Registered filter factories:
  attributeFilter
  chargeFilter
  originVolumeFilter
  particleFilter
  encounteredVolumeFilter

Registered filters:
  None

You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
/control/saveHistory
/run/verbose 2
#
# Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize
userDetector->Construct() start.
Checking overlaps for volume Envelope:0 (G4Box) ... OK! 
Checking overlaps for volume Shape1:0 (G4Cons) ... OK! 
Checking overlaps for volume Shape2:0 (G4Trd) ... OK! 
World is registered to the default region.
physicsList->Construct() start.
### HadronInelasticQBBC Construct Process:
    Emin(FTFP)= 3 GeV; Emax(FTFP)= 100000 GeV
    Emin(BERT)= 1 GeV; Emax(BERT)= 6 GeV; Emax(BERTpions)= 12 GeV;
    Emin(BIC) = 0 GeV; Emax(BIC)= 1.5 GeV.
physicsList->CheckParticleList() start.
physicsList->setCut() start.
#
# Visualization setting
/control/execute vis.mac
# Macro file for the visualization setting in the initialization phase
# of the B1 example when running in interactive mode
#
# Specify a viewer, e.g., /vis/open OGL, or allow a system choice:
/vis/open
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600x600-0+0

Thanks, though the point at which the segfault’s happening appears to be in the vis setup (though @Allison can confirm), it doesn’t have an obvious cause. Could you run this under gdb to get a backtrace from the fault? This should just be a case of

$ gdb ./exampleB1
... startup etc ...
(gdb) run
... should run until segfault ...
(gdb) bt
... should provide a trace of the calls and where the fault happened ...

If you can do that and post what bt prints, we should have more info to go from.

I tried, but the previous error of libG4graphics_reps.so not being found persists. Do I have to source it everytime again before running the example?

GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./exampleB1...
(No debugging symbols found in ./exampleB1)
(gdb) run
Starting program: /home/jingsyuenwong19/jingsyuen/Geant4/geant4-v11.2.2/examples/basic/B1/build/exampleB1 
/home/jingsyuenwong19/jingsyuen/Geant4/geant4-v11.2.2/examples/basic/B1/build/exampleB1: error while loading shared libraries: libG4graphics_reps.so: cannot open shared object file: No such file or directory
[Inferior 1 (process 1631) exited with code 0177]
(gdb) bt
No stack.

Yes, the geant4.sh script needs sourcing in every new terminal you start. If this is the only install of Geant4 you’ll be using, then you could add this command to your shell’s .rc file, e.g. .bashrc if this is Bash shell.

Below is the output:

GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./exampleB1...
(No debugging symbols found in ./exampleB1)
(gdb) run
Starting program: /home/jingsyuenwong19/jingsyuen/Geant4/geant4-v11.2.2/examples/basic/B1/build/exampleB1 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/x86_64-linux-gnu/libthread_db.so.1".
Available UI session types: [ Qt, tcsh, csh ]
[New Thread 0x7fffeff9a640 (LWP 2919)]
QStandardPaths: wrong permissions on runtime directory /run/user/1000/, 0755 instead of 0700
[New Thread 0x7fffef6b7640 (LWP 2920)]

**************************************************************
 Geant4 version Name: geant4-11-02-patch-02    (21-June-2024)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

<<< Reference Physics List QBBC 
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Registered graphics systems are:
  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML2FILE (VRML2FILE)
  gMocrenFile (gMocrenFile)
  TOOLSSG_OFFSCREEN (TSG_OFFSCREEN)
  TOOLSSG_OFFSCREEN (TSG_OFFSCREEN, TSG_FILE)
  OpenGLImmediateQt (OGLIQt, OGLI)
  OpenGLStoredQt (OGLSQt, OGL, OGLS)
  RayTracerX (RayTracerX)
  TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
  TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
Default graphics system is: OGL (based on build flags).
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
Note: Parameters specified on the command line will override these defaults.
      Use "vis/open" without parameters to get these defaults.

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByAttribute
  drawByCharge
  drawByOriginVolume
  drawByParticleID
  drawByEncounteredVolume

Registered models:
  None

Registered filter factories:
  attributeFilter
  chargeFilter
  originVolumeFilter
  particleFilter
  encounteredVolumeFilter

Registered filters:
  None

You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
/control/saveHistory
/run/verbose 2
#
# Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize
userDetector->Construct() start.
Checking overlaps for volume Envelope:0 (G4Box) ... OK! 
Checking overlaps for volume Shape1:0 (G4Cons) ... OK! 
Checking overlaps for volume Shape2:0 (G4Trd) ... OK! 
World is registered to the default region.
physicsList->Construct() start.
### HadronInelasticQBBC Construct Process:
    Emin(FTFP)= 3 GeV; Emax(FTFP)= 100000 GeV
    Emin(BERT)= 1 GeV; Emax(BERT)= 6 GeV; Emax(BERTpions)= 12 GeV;
    Emin(BIC) = 0 GeV; Emax(BIC)= 1.5 GeV.
physicsList->CheckParticleList() start.
physicsList->setCut() start.
#
# Visualization setting
/control/execute vis.mac
# Macro file for the visualization setting in the initialization phase
# of the B1 example when running in interactive mode
#
# Specify a viewer, e.g., /vis/open OGL, or allow a system choice:
/vis/open
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600x600-0+0
[Detaching after fork from child process 2932]

Thread 1 "exampleB1" received signal SIGSEGV, Segmentation fault.
0x00007fffd5cfc945 in llvm::raw_ostream::flush_tied_then_write(char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libigc.so
(gdb) bt
#0  0x00007fffd5cfc945 in llvm::raw_ostream::flush_tied_then_write(char const*, unsigned long) ()
   from /usr/lib/x86_64-linux-gnu/libigc.so
#1  0x00007fffd5cfd107 in llvm::raw_ostream::write(char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libigc.so
#2  0x00007fffd5c7be8c in ?? () from /usr/lib/x86_64-linux-gnu/libigc.so
#3  0x00007fffd5c7c50d in llvm::cl::Option::addArgument() () from /usr/lib/x86_64-linux-gnu/libigc.so
#4  0x00007fffd54481e5 in ?? () from /usr/lib/x86_64-linux-gnu/libigc.so
#5  0x00007fffd4bae8a0 in ?? () from /usr/lib/x86_64-linux-gnu/libigc.so
#6  0x00007ffff7fc947e in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffd548, 
    env=env@entry=0x7fffffffd558) at ./elf/dl-init.c:70
#7  0x00007ffff7fc9568 in call_init (env=0x7fffffffd558, argv=0x7fffffffd548, argc=1, l=<optimized out>) at ./elf/dl-init.c:33
#8  _dl_init (main_map=0x55555641de50, argc=1, argv=0x7fffffffd548, env=0x7fffffffd558) at ./elf/dl-init.c:117
#9  0x00007ffff5ee5af5 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>)
    at ./elf/dl-error-skeleton.c:182
#10 0x00007ffff7fd0ff6 in dl_open_worker (a=0x7fffffff8700) at ./elf/dl-open.c:808
#11 dl_open_worker (a=a@entry=0x7fffffff8700) at ./elf/dl-open.c:771
#12 0x00007ffff5ee5a98 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>)
    at ./elf/dl-error-skeleton.c:208
#13 0x00007ffff7fd134e in _dl_open (file=<optimized out>, mode=-2147483646, caller_dlopen=0x7fffe71f80dd, nsid=-2, argc=1, 
    argv=<optimized out>, env=0x7fffffffd558) at ./elf/dl-open.c:883
#14 0x00007ffff5e0163c in dlopen_doit (a=a@entry=0x7fffffff8970) at ./dlfcn/dlopen.c:56
#15 0x00007ffff5ee5a98 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff88d0, operate=<optimized out>, 
    args=<optimized out>) at ./elf/dl-error-skeleton.c:208
#16 0x00007ffff5ee5b63 in __GI__dl_catch_error (objname=0x7fffffff8928, errstring=0x7fffffff8930, mallocedp=0x7fffffff8927, 
    operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:227
#17 0x00007ffff5e0112e in _dlerror_run (operate=operate@entry=0x7ffff5e015e0 <dlopen_doit>, args=args@entry=0x7fffffff8970)
    at ./dlfcn/dlerror.c:138
#18 0x00007ffff5e016c8 in dlopen_implementation (dl_caller=<optimized out>, mode=<optimized out>, file=<optimized out>)
    at ./dlfcn/dlopen.c:71
#19 ___dlopen (file=<optimized out>, mode=<optimized out>) at ./dlfcn/dlopen.c:81
#20 0x00007fffe71f80dd in ?? () from /usr/lib/wsl/drivers/iigd_dch.inf_amd64_cde0692e341c0589/libigd12um64xel.so
#21 0x00007fffe71d3d53 in ?? () from /usr/lib/wsl/drivers/iigd_dch.inf_amd64_cde0692e341c0589/libigd12um64xel.so
#22 0x00007fffe7157fed in ?? () from /usr/lib/wsl/drivers/iigd_dch.inf_amd64_cde0692e341c0589/libigd12um64xel.so
#23 0x00007fffec63d56e in ?? () from /usr/lib/wsl/drivers/iigd_dch.inf_amd64
--Type <RET> for more, q to quit, c to continue without paging--<RET>
#24 0x00007fffec63d35f in OpenAdapter12 () from /usr/lib/wsl/drivers/iigd_dch.inf_amd64_cde0692e341c0589/libigd12umd64.so
#25 0x00007fffe7d95781 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#26 0x00007fffe7d816a8 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#27 0x00007fffe7cb0b2c in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#28 0x00007fffe7cb0880 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#29 0x00007fffe7cb1489 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#30 0x00007fffe7cb2e40 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#31 0x00007fffe7c6b963 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
#32 0x00007fffed6a39ef in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#33 0x00007fffed6a25ac in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#34 0x00007fffed6a285a in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#35 0x00007fffecbab5f0 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#36 0x00007fffed2026a6 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#37 0x00007fffed2025e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#38 0x00007fffecbabef0 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#39 0x00007fffecbb5266 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#40 0x00007fffeec80143 in ?? () from /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0
#41 0x00007fffeec85fd0 in ?? () from /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0
#42 0x00007fffeec82adc in ?? () from /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0
#43 0x00007fffeece97d3 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
#44 0x00007ffff04eb025 in QXcbWindow::create() () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#45 0x00007ffff04d7636 in QXcbIntegration::createPlatformWindow(QWindow*) const () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#46 0x00007ffff3085b21 in QWindowPrivate::create(bool, unsigned long long) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#47 0x00007ffff3d00297 in QGLContext::chooseContext(QGLContext const*) () from /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#48 0x00007ffff3cfebc2 in QGLContext::create(QGLContext const*) () from /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#49 0x00007ffff3d032bd in QGLWidget::setContext(QGLContext*, QGLContext const*, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#50 0x00007ffff3d03444 in QGLWidgetPrivate::initContext(QGLContext*, QGLWidget const*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#51 0x00007ffff3d03708 in QGLWidget::QGLWidget(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#52 0x00007ffff7c6d8ca in G4OpenGLStoredQtViewer::G4OpenGLStoredQtViewer(G4OpenGLStoredSceneHandler&, G4String const&) ()
   from /home/jingsyuenwong19/jingsyuen/Geant4/geant4-v11.2.2-install/lib/libG4OpenGL.so_cde0692e341c0589/libigd12umd64.so
--Type <RET> for more, q to quit, c to continue without paging--

Thanks! I don’t think this is to do with Geant4 itself but something in the WSL setup, though I can only provide some pointers here:

  1. See this Issue in WSLg, and check if you can run glxgears
  2. Related, see if running as LIBGL_ALWAYS_SOFTWARE=1 ./exampleB1 fixes things.

That’s all I could turn up at the moment.

I tried the second point and it works! Thank you! I have also added the line in the .bashrc file, I will try with other examples now, thanks a lot!

1 Like