scanberg / viamd

Visual Interactive Analysis of Molecular Dynamics
MIT License
273 stars 28 forks source link

Problem with the last release - Segmentation fault (core dumped) #55

Closed xavgit closed 9 months ago

xavgit commented 10 months ago

Hi, I 've downloaded the latest version and used the given instructions to compile it. When I issue ./viamd in the bin directory I receive the following:

$ ./viamd [08:58:22][debug]: Initializing GL... [/home/xxxx/sources/viamd/src/main.cpp:1443] Failed to initialize OpenGL loader! [08:58:23][debug]: Initializing framebuffer... [/home/xxxx/sources/viamd/src/main.cpp:1460] [08:58:23][debug]: Initializing immediate draw... [/home/xxxx/sources/viamd/src/main.cpp:1469] [08:58:23][debug]: Initializing ramachandran... [/home/xxxx/sources/viamd/src/main.cpp:1471] [08:58:23][debug]: Initializing post processing... [/home/xxxx/sources/viamd/src/main.cpp:1473] [08:58:23][debug]: Initializing volume... [/home/xxxx/sources/viamd/src/main.cpp:1475] [08:58:23][debug]: Initializing task system... [/home/xxxx/sources/viamd/src/main.cpp:1477] [08:58:23][error]: One or more shaders are invalid [link_program_transform_feedback] [08:58:23][error]: Program link error: One or more shaders are invalid [link_program] Segmentation fault (core dumped)

I'm using Ubuntu 20.04 Thanks. Saverio

scanberg commented 10 months ago

Hello Saverio (@xavgit). Thanks for bringing this to our attention. What hardware are you currently running on and what graphics driver are you using?

From the log which you provided, it seems that it cannot initialize the OpenGL loader. This is usually a sign that there is a problem with loading the required OpenGL functions, possibly due to incorrect drivers.

Best regards, Robin

xavgit commented 10 months ago

Hi, for the processor: cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 23 model : 24 model name : AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx stepping : 1 microcode : 0x8108102 cpu MHz : 3522.542 cache size : 512 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme ssbd sev ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass bogomips : 4590.97 TLB size : 2560 4K pages clflush size : 64 cache_alignment : 64 address sizes : 43 bits physical, 48 bits virtual power management: ts ttp tm hwpstate eff_freq_ro [13] [14] .......................................................................................................

For the graphics driver: $ glxinfo -B name of display: :0 display: :0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: AMD (0x1002) Device: AMD RAVEN (DRM 3.40.0, 5.4.0-74-generic, LLVM 11.0.1) (0x15d8) Version: 20.3.4 Accelerated: yes Video memory: 2048MB Unified memory: no Preferred profile: core (0x1) Max core profile version: 4.6 Max compat profile version: 4.6 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.2 Memory info (GL_ATI_meminfo): VBO free memory - total: 937 MB, largest block: 937 MB VBO free aux. memory - total: 5786 MB, largest block: 5786 MB Texture free memory - total: 937 MB, largest block: 937 MB Texture free aux. memory - total: 5786 MB, largest block: 5786 MB Renderbuffer free memory - total: 937 MB, largest block: 937 MB Renderbuffer free aux. memory - total: 5786 MB, largest block: 5786 MB Memory info (GL_NVX_gpu_memory_info): Dedicated video memory: 2048 MB Total available memory: 7928 MB Currently available dedicated video memory: 937 MB OpenGL vendor string: AMD OpenGL renderer string: AMD RAVEN (DRM 3.40.0, 5.4.0-74-generic, LLVM 11.0.1) OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.3.4 OpenGL core profile shading language version string: 4.60 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.3.4 OpenGL shading language version string: 4.60 OpenGL context flags: (none) OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.4 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

If this can be useful Chimera , vmd and pymol work with any problem.

Thanks. Saverio

scanberg commented 10 months ago

Hi Saverio,

Thanks for posting the info. I'll make some changes and expose some more error messages from the OpenGL loader and get back to you.

Best, Robin

scanberg commented 9 months ago

Hi again,

Sorry for the delay, It seemed like the point of failure was Imgui loading the OpenGL procedures, which was very odd since it uses a slimmed-down version of the same loader that is used in other parts of the project gl3w. I made some changes to use the same gl3w which seems to load the procedures fine in your case.

The fix should be available in the latest commit (ca753c3153fa1d73efe6e924efb041d8c9d90f03) and will soon be incorporated into a new tag.

If you have the possibility, please check it out and see if it resolves the issue.

Best, Robin

xavgit commented 9 months ago

Hi Robin, OK. I've read the commit in split view. I've used C/C++ many years ago. I've understood the following:

In the file src/core/md_array.h , in my case located at /home/xxxx/sources/viamd/ext/mdlib/src/core , I need to delete "ASSERT(size >= 0);" OK I've found this fix.

In the file src/md_util.h I need to substitute int64_t with size_t in the function bool md_util_unwrap(float in_out_x, float in_out_y, float in_out_z, const int32_t in_idx, int64_t count, const md_unit_cell_t unit_cell); The problem is that I don't find this function as following output tell me: :~/sources/viamd$ pwd /home/xxxx/sources/viamd :~/sources/viamd$ grep -r "bool md_util_unwrap" ext/mdlib/src/md_util.c:bool md_util_unwrap_ortho(float x, float y, float z, vec3_t box_ext, const uint32_t structure_offsets, const int structure_indices, size_t num_structures) { ext/mdlib/src/md_util.c:bool md_util_unwrap_triclinic(float x, float y, float z, const md_unit_cell_t cell, const uint32_t structure_offsets, const int structure_indices, size_t num_structures) { ext/mdlib/src/md_util.h://bool md_util_unwrap_structures_ortho(float in_out_x, float in_out_y, float in_out_z, int64_t count, const md_index_data_t* in_structures, vec3_t box);

Where I'm wrong?

OK? Thanks. Saverio

scanberg commented 9 months ago

Ho Saverio,

I fixed those issues last night in mdlib, but perhaps it was not reflected in VIAMD for some reason. You could try to go into ext/mdlib and do a manual git pull there to get the latest version.

Best, Robin

xavgit commented 9 months ago

Hi Robin, I've downloaded and extracted mdlib-740a1ef36b01ba9d27800fd78a7743c0cdb21b46.zip in the /viamd/ext dir. Then I've renamed the mdlib-.... mdlib and and the old mdlib dir mdlib_old. Then I've applied the steps to compile the sources. I receive errors. These errors are in the attached file. I'm wrong in some step?

Thanks.

Saverio

cmake_errors.txt

scanberg commented 9 months ago

For some reason the git repository viamd and mdlib have gotten out of sync. The easiest fix is to remove the full viamd directory and clone it again:

git clone --recurse-submodules https://github.com/scanberg/viamd.git

Then configure and build again

xavgit commented 9 months ago

Hi Robin, now viamd starts without any problem. This is the output from the command line: $ viamd [13:33:43][debug]: Initializing GL... [/home/xxxx/sources/viamd/src/main.cpp:1443] [13:33:43][debug]: Initializing framebuffer... [/home/xxxx/sources/viamd/src/main.cpp:1460] [13:33:43][debug]: Initializing immediate draw... [/home/xxxx/sources/viamd/src/main.cpp:1469] [13:33:43][debug]: Initializing ramachandran... [/home/xxxx/sources/viamd/src/main.cpp:1471] [13:33:43][debug]: Initializing post processing... [/home/xxxx/sources/viamd/src/main.cpp:1473] [13:33:43][debug]: Initializing volume... [/home/xxxx/sources/viamd/src/main.cpp:1475] [13:33:43][debug]: Initializing task system... [/home/xxxx/sources/viamd/src/main.cpp:1477] [13:33:44][info]: File may also contain trajectory, attempting to load trajectory [13:33:44][debug]: Initializing frame cache with 500 frames. [/home/xxxx/sources/viamd/src/loader.cpp:513] [13:33:44][debug]: Allocating 1.00 MB as frame cache. [13:36:01][debug]: Shutting down immediate draw... [/home/xxxx/sources/viamd/src/main.cpp:2168] [13:36:01][debug]: Shutting down ramachandran... [/home/xxxx/sources/viamd/src/main.cpp:2170] [13:36:01][debug]: Shutting down post processing... [/home/xxxx/sources/viamd/src/main.cpp:2172] [13:36:01][debug]: Shutting down volume... [/home/xxxx/sources/viamd/src/main.cpp:2174] [13:36:01][debug]: Shutting down task system... [/home/xxxx/sources/viamd/src/main.cpp:2176]

Thanks.

Saverio

scanberg commented 9 months ago

Very good,

Thanks again for reaching out and creating an issue. Im closing this issue now.

Best, Robin