The Gigavoxels is a render pipeline that let you render complex volumetric scenes containing billions of voxels as a representation of volumetric. The library has been written by a team of the INRIA after the work of Cyrill Crassin.
The main components are implemented in C++ using mainly CUDA and a bit of OpenGL and the interface uses the Qt API.
A Nvidia GPU is required in order to run the CUDA executable on the GPU side. Be sure to check the compute capability of your specific model because you will need this information later during the configuration of the library.
Warning: if your GPU is to old, it might not even be compatible with CUDA! So, again, check the compute capability before going further.
Be sure to have CUDA installed. Detailed explanations are given on the Nvidia official site for Windows, Linux and Mac.
The library is cross platform thanks to CMake. On Ubuntu 14.04 you can install the maintained package:
sudo apt-get install -y cmake cmake-gui
The GigaVoxels library uses CUDPP currently in the 2.2 version. Unfortunately you need to compile it from source but it is available on GitHub here.
On Linux, you can use git to download the source and the project's submodules:
git clone https://github.com/cudpp/cudpp.git
cd cudpp
git submodule init
git submodule update
Once you have the source code you can run the CMake GUI:
cmake-gui
Firstly, set the paths for the root of the CUDPP repository and where you want the project to be built.
Click on Configure
and choose your type of code generator: Unix Makefiles
for Linux.
Then, set the specific variables (check Advanced
if you can't see those):
- add the
-fPIC
parameter toCMAKE_CXX_FLAGS
andCMAKE_C_FLAGS
- verify the path of
CUDA_TOOLKIT_ROOT_DIR
(/usr/local/cuda/include
for me) - check
CUDPP_BUILD_SHARED_LIBS
- check the compute capability corresponding to your GPU (
CUDPP_GENCODE_SM20
for me)
You can now click again on Configure
and then Generate
and go to the next step: actually compiling CUDPP.
Go to the path you set before (where to build the binaries) and compile.
On Linux with the Unix Makefiles
:
make
sudo make install
You also need additional libraries.
On Ubuntu 14.04 you can install the maintained packages:
sudo apt-get install -y \
libqglviewer-dev \
libmagick++-dev \
freeglut3-dev \
libqt4-dev \
libtinyxml-dev \
libqwt-dev \
cimg-dev \
libassimp-dev \
libglm-dev
Once you have all the prerequisites, download the files of the repository: the source code and some sample data.
git clone https://github.com/webanck/GigaVoxels.git
The source code and the config files for CMake are in the Development directory .
You need to adapt some settings to your environment.
Firstly, if any, give the path of the external required libraries in the file GvSettings_CMakeImport.cmake.
For instance, you might have to change the path of the CUDPP library you compiled earlier or you can move it to /usr/local/cudpp
(see the lines bellow).
#----------------------------------------------------------------
# CUDPP library settings
#----------------------------------------------------------------
if (WIN32)
set (GV_CUDPP_RELEASE "${GV_EXTERNAL}/cudpp")
set (GV_CUDPP_INC "${GV_CUDPP_RELEASE}/include")
set (GV_CUDPP_LIB "${GV_CUDPP_RELEASE}/lib")
# set (GV_CUDPP_BIN "${GV_CUDPP_RELEASE}/bin")
else ()
set (GV_CUDPP_RELEASE "/usr/local/cudpp")
set (GV_CUDPP_INC "${GV_CUDPP_RELEASE}/include")
set (GV_CUDPP_LIB "${GV_CUDPP_RELEASE}/lib")
# set (GV_CUDPP_BIN "${GV_CUDPP_RELEASE}/bin")
endif ()
Secondly, uncomment the compute capability corresponding to your GPU in the following files:
- Development/Library/CMakeLists.txt
- Development/Tools/CMakeLists.txt
- Development/Tutorials/ViewerPlugins/CMakeLists.txt
- Development/Tutorials/Demos/CMakeLists.txt
To help you, the lines of interest are looking like that:
# Set your compute capability version (comment/uncomment with #)
#
# GiagVoxels requires 2.0 at least
list(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
#list(APPEND CUDA_NVCC_FLAGS "-arch=sm_21")
#list(APPEND CUDA_NVCC_FLAGS "-arch=sm_30")
#list(APPEND CUDA_NVCC_FLAGS "-arch=sm_35")
I added a shell script for the Linux users so they only have to launch it to clean and recompile all the library, the tools and the specific example I am working on: the GvDynamicLoad.