Windows 11 - can't run an example after successful(?) compilatin. G4 Exception UI0002

I am trying to install G4 on Windows 11. So far I have successfully installed the program through VS 2022 using this this tutorial (starting on page 8) with the data=on option, then set the variables following the official postinstall setup page (the editor does not allow me to inset a second link). This procedure seems to be ok.

Then i built the B2 example following the first tutorial again (starting on page 30), with seemingly no issues.

The problem appears when I try to run the .exe file. At first it is slowed by the AVG antivirus for a while (no issues detected), then it finishes, but nothing happens.
The cmd is giving me the following errors:

*** ExceptionHandler is not defined ***
*** G4Exception : UI0002
      issued by : G4UIExecutive::G4UIExecutive()
Specified session type is not build in your system,
or no session type is specified.
A fallback session type is used.
*** This is just a warning message. ***
-------- WWWW ------- G4Exception-END -------- WWWW -------
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : UIMAN0123
      issued by : G4UImanager::ApplyCommand
Command aborted (400)
Error code : 400
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

For the full cmd message (including the building process) see the attachment.

TryingToRunB2.txt (2.5 KB)

I would be very happy for any advice.

ERROR: Can not open a macro file <init_vis.mac>. Set macro path with "/control/macroPath" if needed.

The exe has to have access to the mac file(s). Normally (on Unix) you should arrange for the exe to start up in the directory (folder) containing the mac files. Otherwise I guess you can set the macro path as it says.

The other messages are “just warnings”.

Thank you for the information and pointing to the “real” error.
I tried to move the .exe file to the B2a folder, where the run1.mac file is located, but with no success.
I put the full cmd message to the attachment again.
TryExeInB2aFolder.txt (8.3 KB)

Ah! Now you have another issue. The following snippet from your output file tells me you have not built Geant4 with OpenGL:

You have successfully registered the following graphics systems.
Registered graphics systems are:
  ASCIITree (ATree)
  G4HepRep (HepRepXML)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  gMocrenFile (gMocrenFile)

Look at Building and Installing from Source — Geant4 Installation Guide 10.7 documentation. You need to set GEANT4_USE_OPENGL_WIN32.

Thanks! That moved things a little!
I reinstalled G4 with suggested option, rebuilt those examples and copied the .exe file to the parent folder.
Now the file starts, but i get “not responding” trait after a while.
The hardware is idle and there is a “not implemented” error in the cmd message (I tried B1 for a change)

G4OpenGLViewer::DrawText: Not implemented for "viewer-0 (OpenGLStoredWin32)"
  Called with G4Text: "exampleB1"
  layout right, offset (0,0)

Again, I put the full cmd message to the attachment.
StartsButNotResponding.txt (8.7 KB)

Hi again. The message is just a warning. Sorry for verbosity - not sure why it’s so verbose. Still, you should see the detector. Try /run/beam - you should see trajectories. If not try /vis/viewer/refresh and, maybe, /vis/viewer/rebuild. Let us know what happens.

Try B2 again - it does not try to draw any text.

HA! It works!! I truly saw the detector but didn’t do the last step of letting the particles in. Thank a lot for your help (you have actually terminated about a week of pure hell :smiley: )

Only a note for potential future reader: the command /run/beam was not found, but following this tutorial I found that it was “/run/beamOn”.

Hi Fanda

Glad you’re up and running. Apologies, yes, it’s /run/beamOn. (As you have probably found, ls or help are useful for seeing available commands.)


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.