2010-04-08

Bundler on 64-bit Ubuntu 9.10

It builds fine, but seg faults when run:


...
[KeyMatchFull] Matching to image 312
[KeyMatchFull] Matching took 71.610s
[KeyMatchFull] Matching to image 313
[KeyMatchFull] Matching took 69.720s
mkdir: cannot create directory `bundle': File exists
[- Running Bundler -]
/home/binarymillenium/bundler-v0.3-source/RunBundler.sh: line 93: 22589 Segmentation fault $BUNDLER list.txt --options_file options.txt › bundle/out
[- Done -]


Program received signal SIGSEGV, Segmentation fault.
0x0000000000522650 in dscal_ ()
(gdb) bt
#0 0x0000000000522650 in dscal_ ()
#1 0x0000000000519d16 in dsytf2_ ()
#2 0x00000000004e9644 in dsytrf_ ()
#3 0x00000000004a6d99 in sba_symat_invert_BK ()
#4 0x00000000004a05ec in sba_motstr_levmar_x ()
#5 0x000000000049d058 in sba_motstr_levmar ()
#6 0x000000000049ae8e in run_sfm ()
#7 0x0000000000415e06 in BundlerApp::RunSFM(int, int, int, bool, camera_params_t*, v3_t*, int*, v3_t*, std::vector‹std::vector‹std::pair‹int, int›, std::allocator‹std::pair‹int, int› › ›, std::allocator‹std::vector‹std::pair‹int, int›, std::allocator‹std::pair‹int, int› › › › ›&, double, double*, double*, double*, double*, bool) ()
#8 0x000000000042a16e in BundlerApp::BundleAdjustFast() ()
#9 0x0000000000405c33 in BundlerApp::OnInit() ()
#10 0x0000000000406f77 in main ()



I'll update this post with results of trying out the 32-bit binaries, and also trying to build it on 64-bit with 32-bit compilation.

22 comments:

Reza said...
This comment has been removed by the author.
Reza said...

I am also trying to get it to work on 64-bit ubuntu. I get stuck. First with the sift. it says
"sift.txt: 1: ./bin/sift: not found"
but I put it there from the David Lowe zip file. Am I supposed to compile it for 64-bit. When I run make it only produces a file called match. Thanks for any tips.

binarymillenium said...

Reza,

there is a sift executable in the siftDemoV4.zip, it seemed to work fine for me (but bundler itself crashes). You're supposed to copy it into the same bin directory that bundler is in.

binarymillenium said...

It looks like bundler v0.4 has just been released, and it "Removed reference implementations of LAPACK and BLAS due to bugs in 64-bit version"

http://phototour.cs.washington.edu/bundler/

I'll try this out on my 64-bit machine tomorrow.

Reza said...

Yes, and Bundle2Vis works for creating vis.dat file, which is an excellent addition to Bundler v0.4.

I compiled it under ubuntu 8 64-bit. It doesn't recognize the sift for me but on ubuntu 8 32-bit it does recognize the sift. In addition it gives me this error,

bundler: BaseApp.h:273: std::vector >& MatchTable::GetMatchList(MatchIndex): Assertion `p.first != p.second' failed.
./RunBundler.sh: line 93: 12040 Aborted $BUNDLER list.txt --options_file options.txt > bundle/out

I came across PPSS ((Distributed) Parallel Processing Shell Script - parallel processing made easy!)

http://code.google.com/p/ppss/downloads/list

I haven't been able to get it to run in parallel though. My main gripe it to get KeyMatchFull to run in parallel. It HAS been done before, see below link, but I am having trouble with it.

http://pages.cs.wisc.edu/~csverma/CS766_09/FinalProject/classProj.pdf

http://pages.cs.wisc.edu/~csverma/CS766_09/FinalProject/multiviewfinal.pdf

http://pages.cs.wisc.edu/~csverma/CS766_09/FinalProject/MultiView.html

I hope we can all get this to run in parallel on our own images in the near future.

Unknown said...

v0.4 doesn't seem to fix the issue with the segfault ...

froland said...

Hi!

Donno if this is of any help for you, but have you seen the osm-bundler already:

http://code.google.com/p/osm-bundler/

It's a port of bundler completely in pearl. It's part of the open street map project and really easy to run. Maybe you have more luck with this port on 64bit.
Cheers!

Luke Hetrick said...

Hello, I just got bundler working the other day using some of the tips left on this forum regarding how the RunBundler.sh should be a 32 binary in order to get away from that segmentation fault but now I am running into another problem. I am trying to look at around 60 pictures that are 1600x1200 pixels and after RunBundler has done its job, I am lacking almost all the bundle*.out and point*.ply files. Not to mention that my bundle.out file is lacking alot of data. I know I have bundler working right because it goes flawlessly with the ET and kermit examples. Also, I go to run Bundle2PMVS and it passes in about 1/3 of the pictures to convert to PMVS. Has anyone every had any problems like this before? I could really use some guidance here...

Adam Steer said...

hi bundlers - I've gleaned a lot from this blog, so I thought I'd share a success: bundler v0.4 [64 bit] on ubuntu10.4. The story is here: http://adamsteer.blogspot.com/2010/07/bundler-v04-ubuntu-104.html

..but essentially the main problem for me was the jpeg library.

My 100-image run went without a hitch, unfortunately I need to go back and think about getting more useful imagery!

hope it helps...

ali said...

David Lowe's sift binary is built for 32 bit systems. I run it in my 32 bit ubuntu but I can't run it on 64 bit ubuntu.

Unknown said...

hi

sorry for my english

I found a solution to install Bundler-v0.4 in a Ubuntu 10.04 64bits distrib:

http://d.hatena.ne.jp/cos65535/20100630/1277918700

visva said...

It seems, that linux version crashes, when bundler cannot find appropriate pair of cameras, in other words, when it can't reconstruct the scene from presented images. Windows version, in that case, just returns nothing.

Unknown said...

did anyone resolve the seg faults problem?

Unknown said...

Still no luck with the latest bundler.. on 64bit ubuntu 10.10 it just crashed with the same assert...

kenm said...

I had the same problem, x64 ubuntu.

Looking at the assert it is when there is nothing in a list, presumably no keypoint matches.

I was getting about 10 keypoints per image.

Normalizing the images in XnView made the images brighter, adding more keypoints, and now it works.

I think it is just a case of not enough points to match, or not enough matches

Unknown said...

For me (for the same problem), it was the problem of sba-1.5 (sparse bundle adjustment).

I'm using Ubuntu 11.10 64bit.

I solved problem with replacing the library of sba-1.5 by sba-1.6.

But, the tricky thing of this replacement was that definitions (arguments) of two essential functions of sba changed. So, I had to modify sfc.c (in ${BASE_PATH}/lib/sfm_driver).

Even though this post was posted long times ago. This will help someone.

Puneet said...

@ 임재현

What changes did you make into sba 1.6 to make it work on 64bit. I have downloaded sba 1.6 and compiled it (although demo folder doesnt compile but I did get libsba-1.6.a and I have pasted it in lib folder of bundler installation and replace 1.5 version. I tried to make source again and it went fine without any error ( I didnt have to change anything in sfc.c which is weird). But I am still getting memory issue on ubuntu 12.04:

SBA: memory allocation request for 71753728 bytes failed in file sba_levmar.c, line 678, exiting

Puneet said...
This comment has been removed by the author.
Puneet said...

I am also getting following error on 64 bit ubuntu 12.04:

initial motstr-SBA error 148.754 [0.476776]
==12273==
==12273== Process terminating with default action of signal 11 (SIGSEGV)
==12273== General Protection Fault
==12273== at 0x5C8A018: dscal_ (in /usr/lib/libblas/libblas.so.3gf.0)
==12273== by 0x54481A2: dsytf2_ (in /usr/lib/lapack/liblapack.so.3gf.0)
==12273== by 0x544ABF3: dsytrf_ (in /usr/lib/lapack/liblapack.so.3gf.0)
==12273== by 0x4B0ADF: sba_symat_invert_BK (in /home/synrg/workspace/dashboard/bundler/bin/bundler)
==12273== by 0x4A8801: sba_motstr_levmar_x (in /home/synrg/workspace/dashboard/bundler/bin/bundler)
==12273== by 0x4A4228: sba_motstr_levmar (in /home/synrg/workspace/dashboard/bundler/bin/bundler)
==12273== by 0x4A2214: run_sfm (in /home/synrg/workspace/dashboard/bundler/bin/bundler)
==12273== by 0x41851D: BundlerApp::RunSFM(int, int, int, bool, camera_params_t*, v3_t*, int*, v3_t*, std::vector, std::allocator > >, std::allocator, std::allocator > > > >&, double, double*, double*, double*, double*, bool) (Bundle.cpp:614)
==12273== by 0x42BE13: BundlerApp::BundleAdjustFast() (BundleFast.cpp:122)
==12273== by 0x4055E1: BundlerApp::OnInit() (BundlerApp.cpp:1120)
==12273== by 0x407C9D: main (BundlerApp.cpp:1148)



Apparently comment by 임재현 seems to be logical fix since it is related to sfm_driver. I would appreciate if 임재현 can provide changes need to made in sfm_driver after replace sba 1.5 with sba 1.6. It seems they have replaced ncons parameter with mcons but I couldnt understand what exactly needed to be changed.

Unknown said...

please change following in sfm.c (its in lib/sfm_driver)

line (about) 823
/* by Jae Hyun Lim */
#define PTS_CONS 0
#ifdef SBA_V121
if (fix_points == 0) {
if (optimize_for_fisheye == 0) {
/*sba_motstr_levmar(num_pts, num_cameras, ncons,
vmask, params, cnp, 3, projections, NULL, 2,
//remove NULL in prev line for sba v1.2.1
sfm_project_point3, NULL,
(void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info,
use_constraints, constraints,
use_point_constraints,
point_constraints, Vout, Sout, Uout, Wout);*/
sba_motstr_levmar(num_pts, PTS_CONS, num_cameras, ncons,
vmask, params, cnp, 3, projections, NULL, 2,
sfm_project_point3, NULL,
(void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info);

} else {
/*sba_motstr_levmar(num_pts, num_cameras, ncons,
vmask, params, cnp, 3, projections, NULL, 2,
sfm_project_point2_fisheye, NULL,
(void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info,
use_constraints, constraints,
use_point_constraints,
point_constraints, Vout, Sout, Uout, Wout); */
sba_motstr_levmar(num_pts, PTS_CONS, num_cameras, ncons,
vmask, params, cnp, 3, projections, NULL, 2,
sfm_project_point2_fisheye, NULL,
(void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info);
}
} else {
if (optimize_for_fisheye == 0) {
sba_mot_levmar(num_pts, num_cameras, ncons,
vmask, params, cnp, projections, NULL, 2,
sfm_project_point3_mot, NULL,
(void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info/*,
use_constraints, constraints*/);
} else {
sba_mot_levmar(num_pts, num_cameras, ncons,
vmask, params, cnp, projections, NULL, 2,
sfm_project_point2_fisheye_mot, NULL,
(void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info/*,
use_constraints, constraints*/);
}
}
#else
if (fix_points == 0) {
//sba_motstr_levmar(num_pts, num_cameras, ncons,
sba_motstr_levmar(num_pts, PTS_CONS, num_cameras, ncons,
vmask, params, cnp, 3, projections, 2,
sfm_project_point2, NULL, (void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info/*,
use_constraints, constraints,
Vout, Sout, Uout, Wout*/);
} else {
sba_mot_levmar(num_pts, num_cameras, ncons,
vmask, params, cnp, projections, 2,
sfm_mot_project_point, NULL, (void *) (&global_params),
MAX_ITERS, VERBOSITY, opts, info);
}
#endif

Unknown said...

Additionally it seems good to add followings in sba.h (lib/sba-1.6 for my problem ;;;)

line (about) 73 , just add

/*
* This is manipulation by Jae Hyun Lim
* for the purpose of fill the gap between version 1.5 and version 1.6
*/
typedef struct {
char *constrained;
double *constraints;
double *weights;
} camera_constraints_t;

typedef struct {
char constrained;
double constraints[3];
double weight;
} point_constraints_t;

Unknown said...

@Puneet

There might be two way to replace sba-1.5 with sba-1.6

1. if you just add the folder of sba-1.6 in ${BASE_PATH}/lib,
you have to change Makefile of sba-1.6 (make it looks like the one of sba-1.5 provided with bundler),
and Makefiles of ${BASE_PATH}/lib/sfm_driver and ${BASE_PATH}/src

2. replace only source codes of sba-1.5 with the ones of 1.6 except Makefile

Actually, i'm really bad at programming especially on linux; It will help to @ Puneet :)