Thursday, February 4, 2016

Installing CUDA + compiling Infinitam

This post describes how to install and compile Infinitam. A prerequisite for this is to install CUDA (this is also shown here).

Install CUDA
  • I have installed CUDA 8.0.44 (download here)
  • CUDA proposes different ways of installation
    • A .run file, and a .deb file
    • I am currently using the .run file (local version)
    • Follow the steps in the install guide with great care (as the CUDA install can be very tricky)
  • After this the CUDA samples and Infinitam compile fine

Install Infinitam
  • Clone Infinitam from here
  • Follow the steps from the on github
    • From the created build folder  
             cmake ../InfiniTAM -DOPEN_NI_ROOT=/home/arennuit/Tools/AsusXtion/OpenNI2/
    • If cmake complains about missing GLUT libraries (GLUT_Xi_LIBRARY and GLUT_Xmu_LIBRARY) 
             sudo apt-get install libxmu-dev libxi-dev  (more info here)
  • At this point use ccmake check that cmake is pointing to the right version of OpenNI (which should be OpenNI2)
    • ccmake ../InfiniTAM
    • press 't' to toggle to the advatnced mode
    • check cmake variables OpenNI_LIBRARY (there are 3 OpenNI variables)
    • cmake has a tendency to choose old OpenNI 1 path in /usr/lib or /usr/local/lib (the error is described here)
    • change the value of OpenNI_LIBRARY to where it should point to /home/arennuit/Tools/AsusXtion/OpenNI2/Bin/x64-Release/ 
    • configure with 'c' and regenerate with 'g'
    • run cmake ../InfiniTAM
  • make
  • test using sudo ./Infinitam
    • without sudo we get Warning: USB events thread - failed to set priority. This might cause loss of data
    • sudo is required to set the USB async priority thread to critical (more details here)
  • Also it can happen that the camera is not detected
    • we get cout messages stalling at trying OpenNI device: <OpenNI default device>
    • or at OpenNI: Initialization ...
    • and ctrl+c may not work
    • in this case change USB port and restart (from a new terminal?)

NOTE: in my situation (but it seems to only occur in some specific configurations) there is a USB bandwidth problem. Even though the RGB data is not used in the registration it is streamed over USB. And in some configurations the USB is a bottleneck.
A workaround is to ask for a reduced resolution RGB image. This can be done by modifying the constructor in file InfiniTAM/InfiniTAM/Engine/OpenNIEngine.h and replacing
imageSize_rgb = Vector2i(640, 480) by imageSize_rgb = Vector2i(320, 240). More details in this issue.

No comments:

Post a Comment