-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not load the Qt platform plugin "xcb" #308
Comments
Hey, To understand the problem you observe, we need some extra information: opengate_tests is a convenience binary which loops over all eligible tests. From your output, it seems that test008 fails. Can you run that test separately please and report the output? To understand better: does the loop of tests triggered by opengate_tests actually stop at the indicated position or is this just the portion you posted? Part of the output you get is related to Qt, i.e. a visualization engine, but the tests you are running at that moment do not use any visualization. Have you modified the tests, e.g. activated visualization via |
Hey no worries, I follow the changes here on GitHub with great interest and see the process of restructuring the code implementation. System configuration:I'm using a virtual server running Ubuntu 22.04.3 LTS, 2 physical processors, 16 cores, 16 threads, Intel(R) Xeon(R) Gold 6148 CPU @ 2.40 GHz, 32 GB RAM. GATE version:Gate version 10.0b6 See opengate_info**test:**~/opengate_env/lib/python3.11/site-packages/opengate$ opengate_info Importing opengate (thread 342364) ... done Python version 3.11.6 (main, Oct 23 2023, 22:48:54) [GCC 11.4.0] Platform linux Site package /home/opengate_env/lib/python3.11/site-packages Geant4 version geant4-11-01-patch-01 [MT] Geant4 MT True Geant4 GDML True Geant4 date (10-February-2023) Geant4 data /home/opengate_env/lib/python3.11/site-packages/opengate_core/geant4_data ITK version 5.2.1 GATE version 10.0b6 GATE folder /home/opengate_env/lib/python3.11/site-packages/opengate GATE date 2023-11-03T14:05:19 (pypi) Have you installed via pip install, or via a developer install?I followed the instructions of @tbaudier in this issue: #245 (comment)_ using one of the latest dist files of the scheduled CI runs (don't remember which one exactly). I diid this because the regular pip installation process didn't work for some reason. Can you run that test separately please and report the output?Sure thing, see below. It results in the same error namely Aborted (core dumped). See full log for python test0008_dose_actor.pytest:~/opengate_env/lib/python3.11/site-packages/opengate/tests/src$ python test008_dose_actor.py Importing opengate (thread 360409) ... done Importing opengate (thread 360444) ... done Importing opengate (thread 360482) ... done Simulation: create RunManager (single thread) Simulation: initialize Geometry Simulation: initialize Physics Simulation: initialize Source Simulation: initialize Actors Simulation: initialize G4RunManager Simulation: check volumes overlap -------------------------------------------------------------------------------- Simulation: START (in a new process) Simulation: STOP. Run: 1. Time: 7.3 seconds. -------------------------------------------------------------------------------- Runs 1 Events 49945 Tracks 1361355 Step 3278176 Init 0.622728 622.728 ms Duration 8.506152 8.50615 s PPS 5872 TPS 160044 SPS 385389 start Wed Dec 13 12:35:00 2023 stop Wed Dec 13 12:35:09 2023 Sim start 0 ps Sim end 1 s Threads 1 Track types: {'Ar40': 2, 'B10': 27, 'B11': 53, 'B12': 3, 'B13': 1, 'Be10': 5, 'Be7': 2, 'Be8': 168, 'Be9': 6, 'C10': 3, 'C11': 21, 'C12': 737, 'C13': 237, 'C14': 138, 'F15': 1, 'F16': 3, 'He3': 41, 'Li5': 1, 'Li7': 1, 'N12': 2, 'N13': 56, 'N14': 440, 'N15': 535, 'Ne20': 1, 'O14': 18, 'O15': 250, 'O16': 2251, 'O17': 1, 'O18': 2, 'alpha': 833, 'deuteron': 292, 'e+': 23, 'e-': 1289538, 'gamma': 6934, 'neutron': 2201, 'proton': 56476, 'triton': 52} DoseActor "dose": dim=[99, 99, 99] spacing=[2.0, 2.0, 2.0] /home/opengate_env/lib/python3.11/site-packages/opengate/tests/src/../output/test008-edep.mhd tr=[2.0, 3.0, -2.0] Runs: 1 1 Events: 49945 50000 : -0.11 % (tol = 11.00 %) Tracks: 1361355 1340714 : +1.54 % (tol = 11.00 %) Steps: 3278176 3021614 : +8.49 % (tol = 11.00 %) PPS: 5871.6 5160.9 : +13.8% speedup = x1.1 TPS: 160043.6 138386.6 : +15.6% speedup = x1.2 SPS: 385388.8 311886.6 : +23.6% speedup = x1.2 Tracks : {'Ar40': 2, 'B10': 27, 'B11': 53, 'B12': 3, 'B13': 1, 'Be10': 5, 'Be7': 2, 'Be8': 168, 'Be9': 6, 'C10': 3, 'C11': 21, 'C12': 737, 'C13': 237, 'C14': 138, 'F15': 1, 'F16': 3, 'He3': 41, 'Li5': 1, 'Li7': 1, 'N12': 2, 'N13': 56, 'N14': 440, 'N15': 535, 'Ne20': 1, 'O14': 18, 'O15': 250, 'O16': 2251, 'O17': 1, 'O18': 2, 'alpha': 833, 'deuteron': 292, 'e+': 23, 'e-': 1289538, 'gamma': 6934, 'neutron': 2201, 'proton': 56476, 'triton': 52} Tracks (ref): {} Tracks vs track_types : 1361355 1361355 Does the loop of tests triggered by opengate_tests actually stop at the indicated position or is this just the portion you posted?I just posted the corresponding part of the output as I figured everything else would be too long. For the sake of completeness I will attach the full opengate_tests output below. There are multiple tests that result in the same error message. See full log of opengate_tests. Attention: super longtest:~/opengate_env/lib/python3.11/site-packages/opengate$ opengate_tests Importing opengate (thread 342400) ... done Look for tests in: /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/src Ignoring: test039_hits_memory_check_mp_wip.py (Work In Progress) Ignoring: test013_phys_lists_2_wip.py (Work In Progress) Ignoring: test060_phsp_source_particlename_fromphs_particlename_wip.py (Work In Progress) Ignoring: test013_phys_lists_5_wip.py (Work In Progress) Ignoring: test013_phys_lists_3_wip.py (Work In Progress) Ignoring: test018_pet_wip.py (Work In Progress) Ignoring: test045_speedup_all_wip.py (Work In Progress) Ignoring: test043_garf_training_dataset_full_wip.py (Work In Progress) Ignoring: test024_py_actor_wip.py (Work In Progress) Ignoring: test021_voxel_source_old_wip.py (Work In Progress) Running 136 tests ---------------------------------------------------------------------- Running: test001_g4threevector.py OK 3.2 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test001_g4threevector.py.log Running: test002_g4string.py OK 3.2 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test002_g4string.py.log Running: test003_g4material.py OK 3.2 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test003_g4material.py.log Running: test004_simple.py OK 5.9 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test004_simple.py.log Running: test004_simple_mt.py OK 15.7 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test004_simple_mt.py.log Running: test004_simple_subprocess.py OK 11.8 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test004_simple_subprocess.py.log Running: test004_simulation_stats_actor.py OK 5.3 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test004_simulation_stats_actor.py.log Running: test005_proton.py OK 5.7 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test005_proton.py.log Running: test006_runs.py OK 4.6 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test006_runs.py.log Running: test007_volumes.py OK 9.4 s /home/opengate_env/lib/python3.11/site-packages/opengate/tests/../tests/log/test007_volumes.py.log Importing opengate (thread 342912) ... done Importing opengate (thread 343065) ... Importing opengate (thread 343103) ... done Simulation: create RunManager (single thread) Simulation: initialize Geometry Simulation: initialize Physics Simulation: initialize Source Simulation: initialize Actors Simulation: initialize G4RunManager Simulation: check volumes overlap -------------------------------------------------------------------------------- Simulation: START (in a new process) Simulation: STOP. Run: 1. Time: 7.4 seconds. -------------------------------------------------------------------------------- done QObject::moveToThread: Current thread (0x9b23b00) is not the object's thread (0x98a3f40). Cannot move to target thread (0x9b23b00) |
Thanks for posting and for following our work. It seems to me that the core dump occurs within the function assert_images(...) in opengate/tests/utility.py when the function tries to plot the dose images via fig, ax = plt.subplots(ncols=1, nrows=1, figsize=(25, 10))
plot_img_axis(ax, img1, "reference", axis)
plot_img_axis(ax, img2, "test", axis)
if fig_name is None:
n = filename2.replace(".mhd", "_test.png")
else:
n = fig_name
print("Save image test figure :", n)
plt.savefig(n) Could you try commenting these lines and share the output of test008_dose_actor.py? I suspect that something is wrong with the backend of your matplotlib installation. I guess your default backend is Qtagg, which relies on Qt because that would explain the Qt errors. Are you able to plot anything with python/matplotlib in the virtualenvironment in which GATE 10 is installed? import matplotlib.pyplot as plt
plt.plot([1,2,3], [1,4,9])
plt.savefig('.test_matplotlib.png') Can you please also do the following in a terminal:
and see if the error still occurs? matplotlib should pickup the variable MPLBACKEND and set the backend to the non-interactive "Agg". |
Thank you for your response @nkrah. I did as you said and get the following output ending with "Great, tests are ok.". python test008_dose_actor.pytest:~/opengate_env/lib/python3.11/site-packages/opengate/tests/src$ python test008_dose_actor.py Importing opengate (thread 446163) ... done Importing opengate (thread 446199) ... done Importing opengate (thread 446237) ... done Simulation: create RunManager (single thread) Simulation: initialize Geometry Simulation: initialize Physics Simulation: initialize Source Simulation: initialize Actors Simulation: initialize G4RunManager Simulation: check volumes overlap -------------------------------------------------------------------------------- Simulation: START (in a new process) Simulation: STOP. Run: 1. Time: 8.2 seconds. -------------------------------------------------------------------------------- Runs 1 Events 49945 Tracks 1361355 Step 3278176 Init 1.333599 1.3336 s Duration 10.730168 10.7302 s PPS 4655 TPS 126872 SPS 305510 start Thu Dec 14 15:06:18 2023 stop Thu Dec 14 15:06:30 2023 Sim start 0 ps Sim end 1 s Threads 1 Track types: {'Ar40': 2, 'B10': 27, 'B11': 53, 'B12': 3, 'B13': 1, 'Be10': 5, 'Be7': 2, 'Be8': 168, 'Be9': 6, 'C10': 3, 'C11': 21, 'C12': 737, 'C13': 237, 'C14': 138, 'F15': 1, 'F16': 3, 'He3': 41, 'Li5': 1, 'Li7': 1, 'N12': 2, 'N13': 56, 'N14': 440, 'N15': 535, 'Ne20': 1, 'O14': 18, 'O15': 250, 'O16': 2251, 'O17': 1, 'O18': 2, 'alpha': 833, 'deuteron': 292, 'e+': 23, 'e-': 1289538, 'gamma': 6934, 'neutron': 2201, 'proton': 56476, 'triton': 52} DoseActor "dose": dim=[99, 99, 99] spacing=[2.0, 2.0, 2.0] /home//opengate_env/lib/python3.11/site-packages/opengate/tests/src/../output/test008-edep.mhd tr=[2.0, 3.0, -2.0] Runs: 1 1 Events: 49945 50000 : -0.11 % (tol = 11.00 %) Tracks: 1361355 1340714 : +1.54 % (tol = 11.00 %) Steps: 3278176 3021614 : +8.49 % (tol = 11.00 %) PPS: 4654.6 5160.9 : -9.8% speedup = x0.9 TPS: 126871.7 138386.6 : -8.3% speedup = x0.9 SPS: 305510.2 311886.6 : -2.0% speedup = x1.0 Tracks : {'Ar40': 2, 'B10': 27, 'B11': 53, 'B12': 3, 'B13': 1, 'Be10': 5, 'Be7': 2, 'Be8': 168, 'Be9': 6, 'C10': 3, 'C11': 21, 'C12': 737, 'C13': 237, 'C14': 138, 'F15': 1, 'F16': 3, 'He3': 41, 'Li5': 1, 'Li7': 1, 'N12': 2, 'N13': 56, 'N14': 440, 'N15': 535, 'Ne20': 1, 'O14': 18, 'O15': 250, 'O16': 2251, 'O17': 1, 'O18': 2, 'alpha': 833, 'deuteron': 292, 'e+': 23, 'e-': 1289538, 'gamma': 6934, 'neutron': 2201, 'proton': 56476, 'triton': 52} Tracks (ref): {} Tracks vs track_types : 1361355 1361355 This means you already spotted the right part of the code, thank you! Does matplotlib work at all?Yes, I can run the lines of code you provided me with and it works fine and saves the test picture as expected (in the same virtual environment in which I'm also using GATE) Agg backendI removed the coments in front of the code you asked me to comment out to go back to the original implementation of utility.py and run the codes to change the backend. This actually also worked fine. Agg backend run resultstest:~/opengate_env/lib/python3.11/site-packages/opengate/tests/src$ export MPLBACKEND=agg (opengate_env) (base) test:~/opengate_env/lib/python3.11/site-packages/opengate/tests/src$ python test008_dose_actor.py Importing opengate (thread 447022) ... done Importing opengate (thread 447071) ... done Importing opengate (thread 447109) ... done Simulation: create RunManager (single thread) Simulation: initialize Geometry Simulation: initialize Physics Simulation: initialize Source Simulation: initialize Actors Simulation: initialize G4RunManager Simulation: check volumes overlap -------------------------------------------------------------------------------- Simulation: START (in a new process) Simulation: STOP. Run: 1. Time: 7.3 seconds. -------------------------------------------------------------------------------- Runs 1 Events 49945 Tracks 1361355 Step 3278176 Init 0.626478 626.478 ms Duration 8.483392 8.48339 s PPS 5887 TPS 160473 SPS 386423 start Thu Dec 14 15:16:14 2023 stop Thu Dec 14 15:16:23 2023 Sim start 0 ps Sim end 1 s Threads 1 Track types: {'Ar40': 2, 'B10': 27, 'B11': 53, 'B12': 3, 'B13': 1, 'Be10': 5, 'Be7': 2, 'Be8': 168, 'Be9': 6, 'C10': 3, 'C11': 21, 'C12': 737, 'C13': 237, 'C14': 138, 'F15': 1, 'F16': 3, 'He3': 41, 'Li5': 1, 'Li7': 1, 'N12': 2, 'N13': 56, 'N14': 440, 'N15': 535, 'Ne20': 1, 'O14': 18, 'O15': 250, 'O16': 2251, 'O17': 1, 'O18': 2, 'alpha': 833, 'deuteron': 292, 'e+': 23, 'e-': 1289538, 'gamma': 6934, 'neutron': 2201, 'proton': 56476, 'triton': 52} DoseActor "dose": dim=[99, 99, 99] spacing=[2.0, 2.0, 2.0] /home//opengate_env/lib/python3.11/site-packages/opengate/tests/src/../output/test008-edep.mhd tr=[2.0, 3.0, -2.0] Runs: 1 1 Events: 49945 50000 : -0.11 % (tol = 11.00 %) Tracks: 1361355 1340714 : +1.54 % (tol = 11.00 %) Steps: 3278176 3021614 : +8.49 % (tol = 11.00 %) PPS: 5887.4 5160.9 : +14.1% speedup = x1.1 TPS: 160473.0 138386.6 : +16.0% speedup = x1.2 SPS: 386422.8 311886.6 : +23.9% speedup = x1.2 Tracks : {'Ar40': 2, 'B10': 27, 'B11': 53, 'B12': 3, 'B13': 1, 'Be10': 5, 'Be7': 2, 'Be8': 168, 'Be9': 6, 'C10': 3, 'C11': 21, 'C12': 737, 'C13': 237, 'C14': 138, 'F15': 1, 'F16': 3, 'He3': 41, 'Li5': 1, 'Li7': 1, 'N12': 2, 'N13': 56, 'N14': 440, 'N15': 535, 'Ne20': 1, 'O14': 18, 'O15': 250, 'O16': 2251, 'O17': 1, 'O18': 2, 'alpha': 833, 'deuteron': 292, 'e+': 23, 'e-': 1289538, 'gamma': 6934, 'neutron': 2201, 'proton': 56476, 'triton': 52} Tracks (ref): {} Tracks vs track_types : 1361355 1361355 Pip listBelow the result of the pip list command. It seems as if I have the same matplotlib version as @jizhang02. pip list of opengate_envtest:~/opengate_env/lib/python3.11/site-packages/opengate/tests/src$ pip list
ConclusionDo I just always change the backend to Agg now or is there any other way to reinstall the matplotlib backend or whatever it is that is not working. I tried to reinstall various packages based on stackoverflow suggestions for similar problems but nothing fixed it yet. |
Running opengate_tests leads to the following error message. How do I resolve that (reinstalling opengate_core and opengate didn't work)?
It used to work and suddenly stopped to do so, no idea why.
The text was updated successfully, but these errors were encountered: