1. Home
  2. Docs
  3. Getting Started
  4. Installation – Linux

Installation – Linux

LightBuzz proudly supports Ubuntu Linux LTS. To use our software on Linux, you need to perform some additional installation steps.

Hardware requirements

The LightBuzz Body Tracking SDK requires hardware acceleration. On Linux, this is best accomplished using NVIDIA CUDA. So, your computer needs to have a CUDA graphics card (GeForce GTX 960 or later). As long as you have an NVIDIA card, you can move on to the installation steps.

NVIDIA Drivers

Go to the Application Menu, search for Software & Updates and select it.

When Software & Updates window opens, navigate to the Additional Drivers tab and select the latest proprietary and tested driver.

Ubuntu Software and Updates - Additional Drivers

Select Apply Changes. Wait for the system to make the updates and click Close. Then, restart your computer to apply the driver changes. After restarting, verify that you have the correct drivers by opening a terminal and running:

nvidia-smi

This should show you the installed NVIDIA driver version.

CUDA 11.0

Check your installation

If this is your first time installing CUDA on this computer, skip this step.

To verify if you already have CUDA installed on this computer, open a terminal and run:

nvcc -V

This should show you the installed CUDA version or an error:

  • In case of a generic error, there is no CUDA installed and you can continue with the installation.
  • In case the CUDA version is 11.0, you can skip the CUDA installation.
  • In case the CUDA version is different than 11.0, you need to uninstall it. Open a terminal and run the following commands:
sudo rm -rf /usr/local/cuda*
sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*" 
sudo apt-get autoremove
sudo apt-get autoclean

Install CUDA

Go to the NVIDIA website and select your configuration for CUDA 11.0.

NVIDIA CUDA for Ubuntu - Download

After selecting your configuration, you will see the installation instructions.

NVIDIA CUDA for Ubuntu - Installation Instructions

Open a terminal and download the CUDA 11.0 toolkit:

wget https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run

Then, install the toolkit:

sudo sh cuda_11.0.3_450.51.06_linux.run

This may take some time. Be patient 🙂

During the installation process, the installer will let you know that an existing driver is found. Select Continue.

Then, you need to read and accept the EULA. Type accept.

NVIDIA CUDA for Ubuntu - EULA

The CUDA toolkit comes with an older NVIDIA driver than the one you previously installed, so make sure to deselect the option to install the driver and select Install.

NVIDIA CUDA for Ubuntu - Installer

When the installation is finished, you need to add CUDA to the system paths. Open bashrc and type the following commands:

source ~/.bashrc
sudo nano ~/.bashrc

Go to the end of the file and add the path to CUDA.

export PATH=/usr/local/cuda-11.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

To save the changes, press Ctrl + o. Press Enter to accept the changes and Ctrl + x to close nano. Then, restart your computer to apply the changes. After restarting, verify that you have successfully installed CUDA by opening a terminal and running:

nvcc -V

That should show you the installed CUDA version.

cuDNN 8.0.4 for CUDA 11.0

Moving forward, you need to install cuDNN. Go to the NVIDIA cuDNN archive and select cuDNN 8.0.4 (September 28th, 2020), for CUDA 11.0.

NVIDIA cuDNN for Ubuntu - Download

Select the option: cuDNN Library for Linux (x86_64).

You will be prompted to log in using an NVIDIA developer account. Click Login if you already have an account, or Join now to create one.

After you provide your username and password, you’ll be redirected to your account. You can now download the cuDNN library by clicking on the notification.

NVIDIA cuDNN for Ubuntu - Confirmation

A window will open to ask if you want to save the file. Select Save File and OK.

Open a terminal and navigate to the Downloads folder.

cd ~/Downloads

Unzip the cuDNN library and copy the files to the CUDA folder.

tar -zxvf cudnn-11.0-linux-x64-v8.0.4.30.tgz
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-11.0/lib64/
sudo cp  cuda/include/cudnn.h /usr/local/cuda-11.0/include/
sudo chmod a+r /usr/local/cuda-11.0/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

Install the libcupti-dev package.

sudo apt-get install libcupti-dev

ONNX Runtime binaries

Open the LightBuzz SDK folder you downloaded and copy the ONNX Runtime binaries to /usr/lib/x86_64-linux-gnu/:

sudo cp libonnxruntime.so.1.7.0 /usr/lib/x86_64-linux-gnu/libonnxruntime.so.1.7.0

OpenCV

Next, you need to install the OpenCV framework dependency.

Open a Terminal window and run the following commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential cmake unzip pkg-config
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python3.6-dev

Download OpenCV:

cd ~
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.4.0.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.4.0.zip

Unzip the folders and rename them.

unzip opencv.zip
unzip opencv_contrib.zip
mv opencv-4.4.0 opencv
mv opencv_contrib-4.4.0 opencv_contrib

Install the numpy package.

pip install numpy

Configure OpenCV with CMake.

cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D OPENCV_GENERATE_PKGCONFIG=YES \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D WITH_CUDA=OFF \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
    -D OPENCV_ENABLE_NONFREE=ON \
    -D BUILD_EXAMPLES=ON ..

Then, build OpenCV. This step may take some time.

make -j4

Install OpenCV.

sudo make install
sudo ldconfig

Finally, verify that you have successfully installed OpenCV by running the following command:

pkg-config --modversion opencv4

That should show you the installed OpenCV version.

Unity3D

Unity3D supports Ubuntu. Go to the Unity website and click the Download Unity Hub button.

A window will open to ask if you want to save the file. Select Save File and OK. This will save the file in the Downloads folder.

Open your terminal, navigate to the Downloads folder and run the following command:

cd ~/Downloads
chmod +x UnityHub.AppImage

Go to the Downloads folder and double-click the UnityHub.AppImage. This should open the Unity Hub. Go to the Installs and click the Add button. Select the latest Unity LTS version and click Next.

Unity3D for Ubuntu - LTS installation

Select the Linux Build Support (IL2CPP) and click Done.

Unity3D for Ubuntu - Linux Build Support (IL2CPP)

When the installation is finished, you should be able to use the LightBuzz SDK package and run the sample scenes!

Intel RealSense [OPTIONAL]

If you intend to use the Intel RealSense cameras, you need to install the official RealSense packages.

Go to Github and find the v2.47.0 RealSense release. Select the source code (zip). A window will open to ask if you want to save the file. Select Save File and OK.

Go to the Downloads folder and unzip the file.

Then, open a terminal and copy the file to usr/local:

cd ~/Downloads/librealsense-2.47.0
sudo cp -r librealsense-2.47.0 /usr/local

Navigate to the librealsense root directory and run the following scripts:

cd /usr/local/librealsense-2.47.0
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev

Install the Intel Realsense permission scripts.

sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger

Build and apply patched kernel modules.

sudo ./scripts/patch-realsense-ubuntu-lts.sh

Update the build toolchain.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

Create a build folder, build and install binaries.

sudo mkdir build && cd build
sudo cmake ../ -DCMAKE_BUILD_TYPE=Release
sudo make install

Connect your RealSense camera and run the RealSense Viewer app to ensure the packages were installed correctly.

realsense-viewer

How can we help?