Installation
GGNN can be installed as a Python module or compiled as a library for C++/CUDA code.
Dependencies
The following dependencies are required to install the library:
A C++20 compiler and standard library (GCC or Clang version 10 or higher)
CUDA Toolkit version 12 or higher
This includes the Nvidia CUDA compiler
nvcc
The existence and version of these dependencies can be checked with:
nvcc --version
and:
c++ --version
Installing the GGNN Python Module
To install GGNN, first the repository has to be cloned:
git clone https://github.com/cgtuebingen/ggnn.git
The easiest way to install GGNN is from the folder containing the repository:
cd ggnn
The ggnn module can then be installed using the package manager pip:
python3 -m pip install .
Caution
The PyPI package ggnn belongs to a different project.
Running pip install ggnn will not install the GGNN Python module.
Installing the GGNN C++ Library
To install GGNN, first the repository has to be cloned:
git clone https://github.com/cgtuebingen/ggnn.git
The easiest way to install GGNN is from the folder containing the repository:
cd ggnn
The GGNN library can then be built:
mkdir build
cd build
cmake ..
make -j4
Troubleshooting
In case GGNN does not compile, check your CUDA and C++ compilers:
- CUDA
In case
nvcccannot be found bycmake, you may get one of the following errors:Failed to find nvcc.Compiler requires the CUDA toolkit.-- The CUDA compiler identification is unknownFailed to detect a default CUDA architecture.
Set the
PATHandLD_LIBRARY_PATHto your installed CUDA Toolkit, e.g.:export PATH="/usr/local/cuda-12.4/bin/:${PATH}" export LD_LIBRARY_PATH="/usr/local/cuda-12.4/lib64/:${LD_LIBRARY_PATH}"
Now,
nvcc --versionshould print something like this:nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Thu_Mar_28_02:18:24_PDT_2024 Cuda compilation tools, release 12.4, V12.4.131 Build cuda_12.4.r12.4/compiler.34097967_0
- C++
For compilation, we support GCC’s
g++>= 10 and LLVM’sclang++>= 10.If you use a different compiler or an outdated version, you may get the following message:
GCC or Clang version 10 or higher required for C++20 support!
You can define which C/C++ compilers should be used with the following environment variables:
# E.g., to use GCC 10, set the following: export CC=gcc-10 export CXX=g++-10 export CUDAHOSTCXX=g++-10
Also, make sure to have the matching C++ standard library version installed.
For GCC 10, install the following on Ubuntu:
g++-10andlibstdc++-10-devFor Clang 10, install the following on Ubuntu:
clang-10,libc++-10-dev, andlibc++abi-10-devSimilarly for newer versions.
This has been tested on Ubuntu 20.04. Newer versions will ship newer versions by default. E.g., GCC 13 and Clang 18 on Ubuntu 24.04, which should work out-of-the-box.
- CMake
Make sure to re-run
cmakein a freshbuildfolder after exporting these environment variables. Otherwise,cmakemay use settings from a cached configuration.