nmoehrle / mvs-texturing

Algorithm to texture 3D reconstructions from multi-view stereo images
Other
933 stars 328 forks source link

Illegal instruction: 4 while executing #112

Open theonlynick0430 opened 5 years ago

theonlynick0430 commented 5 years ago

I am attempting to execute MVS on the output of MVE on a Mac. I run the following command: ./texrecon /Users/nikhilsridhar/Desktop/kermit-output::undistorted /Users/nikhilsridhar/Desktop/kermit-output/surface-clean.ply /Users/nikhilsridhar/Desktop/kermit-output/textured

I get the following output:

./texrecon (built on Nov 21 2018, 14:11:02)
Load and prepare mesh: 
PLY Loader: comment Export generated by libmve
Reading PLY: 1414 verts... 2692 faces... done.
Generating texture views: 
Initializing scene with 12 views...
Initialized 11 views (max ID is 10), took 1ms.
        Loading 36%...Warning: View undistorted04 has no byte image undistorted 
        Loading 45%...Warning: View undistorted06 has no byte image undistorted 
        Loading 73%...Building adjacency graph:                                 
        Adding edges 100%... done. (Took 0.019s)                                
    3971 total edges.
View selection:
    Building BVH from 2692 faces... done. (Took: 3 ms)
        Calculating face qualities 100%... done. (Took 0.188s)                  
        Postprocessing face infos 100%... done. (Took 0.001s)                   
    Maximum quality of a face within an image: 258.603
    Clamping qualities to 107.719 within normalization.
    Writing data cost file... done.
    Optimizing:
        Time[s] Energy
Illegal instruction: 4

Am I doing anything wrong?

nmoehrle commented 5 years ago

This issue relates to mapMAP the MRF optimizer that we use, do you have SSE, AVX or AVX-2?

nmoehrle commented 5 years ago

Closing this due to inactivity.

nbfuhao commented 5 years ago

I'm experiencing the same problem using a 2016 macbook pro. The output of sysctl -a | grep machdep.cpu.features shows SSE and AVX is supported by the CPU. Any ideas how to avoid the problem?

carrypann commented 5 years ago

The same problem occurred on 2018 MacBook Pro.

razvanmargineanu commented 3 years ago

Experienced the same behaviour while attempting texturing a 414 image set. Process used ~10Gb of RAM at that stage, then was automatically halted at View selection > Optimizing Stage. Recompiled with these flags on ubuntu a 16 core AMD Ryzen. mapMap successfully finished processing for me. By editing your CMakeLists.txt

if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx -Wall -Wextra -Wundef -pedantic")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -march=native -funroll-loops")
endif()

An alternative would be to swap -march=native with -march=both and recompile. (untested)