luckybulldozer / VisualSFM_OS_X_Installer

VisualSFM installer script for OS X
GNU General Public License v2.0
162 stars 49 forks source link

Freezes upon looking for pairs #3

Open Jmuccigr opened 10 years ago

Jmuccigr commented 10 years ago

Installation seems to have gone fine on my late MacBook Pro 8,1 with an Intel Core i7 @ 2.7 GHz running 10.9.4. 16GB RAM, about 15GB free on the hard drive.

I load some photos. Fine. Then I click to run the feature detection & full pairwise image matching and the Mac locks up hard. The mouse still moves and I can SSH into the MBP to find that Windows Manager is using about 100% of a cpu (4 cores). Tried in vain to kill enough processes to regain control, but in the end I had to hard reboot. Nothing obvious (to me!) in Console afterwards.

Went in and tried killing SiftGPU, since there's no GPU support, and then it throws an error: "Unable to locate sift binary".

So I'm stuck.

luckybulldozer commented 10 years ago

Hi John, VSFM can get the laptop running pretty hot, which can be quite a worry. Currently there is a bit of an issue with VSFM not respecting the number of threads in the preferences file located at vsfm/bin/nv.ini I think this is what I'd do. Install vlfeat sift from https://github.com/vlfeat/vlfeat/tree/master . Then change these lines in the nv.ini file.

Use the original binary from Lowe if 0, and VLFeat binary otherwise

param_use_vlfeat_or_lowe 1

Select the device for feature matching

0: cpu, 1: glsl, 2+: cuda if compiled in SiftGPU.dll

param_use_siftmatchgpu 0 # do this to disable GPU matching, it's definitely going to slow things down, but keep your macbook alive!

param_cpu_siftmatch_num_thread 2 # I can't seem to get this to use less CPUs... which is essentially you're problem, it's using the GPU for matching and all cores of the CPU, so it's working the computer very hard!

All the best, don't cook that macbook! Please keep me posted. I will update the installer to offer that config and compile vlfeat sift. Cheers, Dan

Jmuccigr commented 10 years ago

Dan, That's not my problem. When I SSH in, I can run top and see that the cpu is fine, as is RAM. Instead all I get on the laptop is the cursor, which moves all over the place, but nothing else is responsive. Killing what I think are the obvious processes (like xquartz) doesn't get me out of the freeze, so I think something fairly bad happens when VSFM starts that matching process.

I'm also a little confused about the GPU. The read.me says "1. libpba_no_gpu.so is made, sorry, no gpu at this stage." So is it being used or not? When I use the Tools menu to stop using the GPU, I get that error I reported above about not finding the binary.

Going to wait for you on this.

Thanks.

Jmuccigr commented 10 years ago

Any more on this?

Again, the problem isn't the cpu's pegging, it's something else.

Jmuccigr commented 10 years ago

Bump

luckybulldozer commented 10 years ago

Try this... change from 0 to the number of threads you want to limit it too... edit the file in vsfm/bin/nv.ini

Limit the number of worker threads (experimental)

param_maximum_cpu_usage 0

gordonro-zz commented 10 years ago

Does it require gcc-4.8 or will gcc-4.9 work too?

Alexander-M commented 10 years ago

I had the same issue as John - my computer locked up hard on matching - and I believe that the issue is indeed related GPU usage (I'm running with only 512MB graphics memory).

By setting 'param_use_siftmatchgpu 0' in the nv.ini (which I see is what Dan suggested, although I did not install VLFeat) I was able to get around this problem successfully.

Thanks to Dan for putting this installer together!

luckybulldozer commented 10 years ago

gordonro: i'm sure gcc 4-9 will be fine, it's just getting around Clang which is the issue, you may need to do a search and replace on every 4.8 to say 4.9, or as a hack you could just alias gcc-4.9 to gcc-4.8 in your path.

Jmuccigr commented 10 years ago

Pretty sure I tried changing param_use_siftmatchgpu, but I'll try it again.

Threads aren't the issue, I don't think. Again, my cpu isn't getting slammed; the computer is becoming mostly unresponsive due to something else.

Jmuccigr commented 10 years ago

OK, here's what happened:

  1. param_use_siftmatchgpu 0 in nv.ini.
  2. Load the photos.
  3. Click on the "Compute missing matches" button.
  4. Output is:

    Compute Missing Pairwise Matching, begin... ***** WARNING *** More than 182MB of graphic memory may be allocated under the default settings. If the program halts here, adjust parameters to save memory and rerun the task: [Tools->Enable GPU->Set Maximum DIM] Note some octaves may be automatically skipped ERROR: unable to load libsiftgpu.so ERROR: unable to get function address SIFT: 0000, 3264x2448, ERROR1 ERROR: unable to locate sift binary.

    ###########-------timing------######### 1 Feature Detection finished, 0 sec used #############################

    91 pairs to compute match NOTE: using 2 matching workers

    ###########-------timing------######### 91 Image Match finished, 1 sec used #############################


    Compute Missing Pairwise Matching, finished Totally 1.000 seconds used

libsiftgpu.so is in VisualSFM_OS_X_Mavericks_Installer-master/SiftGPU/bin/, which ought to be the expected place, no?

luckybulldozer commented 10 years ago

Hi John, Sorry about the situation here... however "param_maximum_cpu_usage 0" is different to "param_use_siftmatchgpu 0". It should throttle over all cpu usage. The reason you are getting the ERROR 1 is because you have switched over to needing to use the Sift binary, so it can't find it... and although VLFeat Sift is great, it's just as processor intensive, so it's no great solution. Since you have an 8 core machine, I suspect if you just set "param_maximum_cpu_usage 0" to about 2 of the eight CPU threads, the activity on the GPU may not be quite as taxing. I did a fair bit of work on my Macbook Pro over the years and I'd literally have the laptop on its side so it wouldn't be heated from the table, then I'd have a desk fan pointing at the thing too, and matching a thousand images could take days even still.

I use the command line too, as it's a bit quicker + the gui doesn't need to load. All you would need to do is ...

VisualSFM sfm+pmvs . out.nvm
Jmuccigr commented 10 years ago

An update:

  1. My cpu was never pegged (or all 4 cores were never pegged). The computer screen went unresponsive, but I could always move the cursor around and I could SSH into it. This suggests to me that it was something with the gpu and maybe vsfm expecting there to be more memory there than there actually is, so it did bad things to active memory.
  2. Assigning a max # of threads did nothing. Still locked up right away.
  3. Following the suggestion in the log window, I lowered the gpu memory DIM to 200 from 3200, since I only have 512 on this computer. (This was also an attempt to address the possible issue raised in point 1 above.) Result: nothing happens. Log says

"Compute Missing Pairwise Matching, begin... 0 pairs to compute match

Compute Missing Pairwise Matching, finished Totally 0.000 seconds used"

Hmmm, now that I think about it, what units is the 3200 in?

  1. param_use_siftmatchgpu to 0 caused the problem where it couldn't find the sift executable. Reading the docs a bit over at ccwu.me, I discovered that the program expects that to be at ./sift, which is wasn't. So here's what I did. In nv.ini:

    param_use_siftgpu 0 param_use_siftmatchgpu 0 param_use_vlfeat_or_lowe 1

In order for that last to work, the vlfeat sift executable has to be in bin, so I downloaded vlfeat from the link at the vxlm website, soft-linked the sift executable into bin and ran vxlm again. Voila! Took 173 seconds to do 13 images. Then took 29 minutes for a dense reconstruction. (Which wasn't very good, but I haven't played with this at all, so that might be why.)

So, Dan, maybe it's worthwhile adding a download of vlfeat and a copy of sift to bin into the .sh just to save some people time? It shouldn't make the install much longer, and having the binary there means changing nv.ini is all someone would have to do.

Jmuccigr commented 10 years ago

Bump

tabbailey091 commented 8 years ago

Could you explain the vlfeat part in more detail? where did you download it? did you just drag the sift file into bin?

Jmuccigr commented 8 years ago

@tabbailey091,

Honestly, it's been so long that I couldn't tell you beyond what I wrote there.