votca / csg

Coarse-graining potentials from atomistic references made easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ubuntu 20 Segmentation fault

felipeZ opened this issue · comments

I recently upgrade my system to Ubuntu 20 and I got the following test errors:

The following tests FAILED:
         52 - integration_Run_csg_reupdate_gmx (SEGFAULT)
         53 - integration_Compare_csg_reupdate_gmx_output (Failed)
         54 - integration_Compare_csg_reupdate_gmx_output2 (Failed)
         94 - integration_Run_csg_dump_gmx_tpr (Failed)
         95 - integration_Compare_csg_dump_gmx_tpr_output (Failed)
         96 - integration_Run_csg_dump_gmx_tpr_excl (Failed)
         97 - integration_Compare_csg_dump_gmx_tpr_excl_output (Failed)
         99 - integration_Run_csg_map_gmx (SEGFAULT)
        100 - integration_Compare_csg_map_gmx_output (Failed)
        101 - integration_Run_csg_map_gmx_xtc (SEGFAULT)
        102 - integration_Compare_csg_map_gmx_xtc_output (Failed)

cmake report that it has found Gromacs:

-- The following RECOMMENDED packages have been found:

 * FFTW3
   Enables FFT functionality
 * GROMACS (required version >= 2019)
   Used to read/write gromacs data files

gmx --version, produces the following output:

GROMACS version:    2019.5                                                                           
Precision:          single                                                                           
Memory model:       64 bit                                                                           
MPI library:        thread_mpi                                                                       
OpenMP support:     enabled (GMX_OPENMP_MAX_THREADS = 64)                                            
GPU support:        CUDA                                                                             
SIMD instructions:  AVX2_256                                                                         
FFT library:        fftw-3.3.8-sse2-avx-avx2-avx2_128-avx512                                   
RDTSCP usage:       enabled                                                                          
TNG support:        enabled                                                                                                                                                                                
Hwloc support:      hwloc-2.1.0                                                                                                                                                                            
Tracing support:    disabled                                                                                                                                                                               
C compiler:         /usr/bin/gcc-8 GNU 8.4.0                                                                                                                                                               
C compiler flags:    -mavx2 -mfma     -O3 -DNDEBUG -funroll-all-loops -fexcess-precision=fast        
C++ compiler:       /usr/bin/g++-8 GNU 8.4.0                                                         
C++ compiler flags:  -mavx2 -mfma    -std=c++11   -O3 -DNDEBUG -funroll-all-loops -fexcess-precision=fast                                                                                                  
CUDA compiler:      /usr/bin/nvcc nvcc: NVIDIA (R) Cuda compiler driver;Copyright (c) 2005-2019 NVIDIA Corporation;Built on Sun_Jul_28_19:07:16_PDT_2019;Cuda compilation tools, release 10.1, V10.1.243   
CUDA compiler flags:-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=compute_75;-use_fast_math;-D_FORCE_INLINES;; ;-mavx2;-mfma;-std=c++11;-O3;-DNDEBUG;-funroll-all-loops;-fexcess-precision=fast;                                           
CUDA driver:        10.20                                                                            
CUDA runtime:       10.10  

Also, All the unit tests from Gromacs pass

Any suggestion about what I am doing wrong?

Isn't Ubuntu 20.04 coming with gmx-2020?
Can you run one of the test by hand, e.g ctest -V -R integration_Run_csg_reupdate_gmx?

Indeed, it is using Gromacs 2020. I am going to make sure that I link to the Gromacs 2019

52: Test command: /home/felipe/Primer/C++/votca/build/csg/src/tools/csg_reupdate "--options" "/home/felipe/Primer/C++/votca/csg/src/tools/references/spce/settings_re.xml" "--top" "topol.tpr" "--trj" "conf.gro" "--hessian-check" "no"
52: Test timeout computed to be: 10000000
52: Reading file topol.tpr, VERSION 2020.1-Ubuntu-2020.1-1 (double precision)
1/1 Test #52: integration_Run_csg_reupdate_gmx ...***Exception: SegFault  0.08 sec

You could run ldd /home/felipe/Primer/C++/votca/build/csg/src/tools/csg_reupdate to see which libgromacs is loaded. In the past libgromacs would warn if you try to open an tpr will generated with a newer version, but a segfault isn't great.

Can you try to run your 2019 gmx binary on the new (2020) tpr from the test, e.g.

gmx dump -s topol.tpr

I have managed to link Votca with Gromacs 2019.5 and I get the following error if I try to run gmx 2019 in the new (2020) tpr :

gmx dump -s ./build/csg/src/tools/Run_gmx_3mols/topol.tpr

GROMACS:      gmx dump, version 2019.5
Executable:   /usr/local/gromacs/bin/gmx
Data prefix:  /usr/local/gromacs
Working dir:  /home/felipe/Primer/C++/votca
Command line:
  gmx dump -s ./build/csg/src/tools/Run_gmx_3mols/topol.tpr

Reading file ./build/csg/src/tools/Run_gmx_3mols/topol.tpr, VERSION 2020.1-Ubuntu-2020.1-1 (double precision)

-------------------------------------------------------
Program:     gmx dump, version 2019.5
Source file: src/gromacs/fileio/tpxio.cpp (line 2695)

Fatal error:
reading tpx file (./build/csg/src/tools/Run_gmx_3mols/topol.tpr) version 119
with version 116 program

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

Hmm, that means for some reason the same error isn't triggered when reading the tpr in votca.

do_tpxheader() triggers the error, which is called in read_tpx(), which is what we call in VOTCA.

Can you check again which libgromacs is loaded at run using ldd?

ldd /home/felipe/Primer/C++/votca/build/csg/src/tools/csg_reupdate
 libgromacs.so.4 => /usr/local/gromacs/lib/libgromacs.so.4

That is the 2019.5 version. I think that the problem was that I was using Gromacs 2020 and it was causing the segmentation fault. Now I just get plain failures in the tests instead of segmentation faults.

What error message now?

Can you reconstruct how you got the segfault? We might want to add a check for that.

Now I am getting this message:

test 52
    Start 52: integration_Run_csg_reupdate_gmx

52: Test command: /home/felipe/Primer/C++/votca/build/csg/src/tools/csg_reupdate "--options" "/home/felipe/Primer/C++/votca/csg/src/tools/references/spce/settings_re.xml" "--top" "topol.tpr" "--trj" "conf.gro" "--hessian-check" "no"
52: Test timeout computed to be: 10000000
52: Reading file topol.tpr, VERSION 2020.1-Ubuntu-2020.1-1 (double precision)
52: 
52: -------------------------------------------------------
52: Program:     GROMACS, version 2019.5
52: Source file: src/gromacs/fileio/tpxio.cpp (line 2695)
52: 
52: Fatal error:
52: reading tpx file (topol.tpr) version 119 with version 116 program
52: 
52: For more information and tips for troubleshooting, please check the GROMACS
52: website at http://www.gromacs.org/Documentation/Errors
52: -------------------------------------------------------
1/1 Test #52: integration_Run_csg_reupdate_gmx ...***Failed    0.01 sec

The segmentation fault error was due to the fact that I was linking VOTCA against Gromacs 2020 instead of 2019.5. I forgot to source the GMXRC file

Ok, the error message is as excepted. You will need to clean out your build dir (or at least the csg-tutorials parts in there) to get rid of that error.

We build against Gromacs-2020 on the CI, so I still don't understand where the segfault came from. Can you try to make a build against Gromacs 2020 on your system?

I have not been able to reproduce the segmentation fault error. I think it was due to an inconsistent state in my zsh environment, I was installing several Gromacs and I made a very messed environment