Installation¶
Kaolin is written with Pytorch and C++ / CUDA for efficient custom ops.
Requirements¶
Linux, macOS or Windows
Python >= 3.6 (3.6 and 3.7 recommended for Windows)
CUDA >= 10.0 (with ‘nvcc’ installed)
Dependencies¶
torch >= 1.5, <= 1.10.2
cython == 0.29.20
scipy >= 1.2.0
Pillow >= 8.0.0
usd-core >= 20.11 (optional, required for USD related features such as visualization and importer / exporter)
Installation from source¶
Note
If you just want to try Kaolin, we recommend using a virtual environment, for instance with Anaconda:
$ conda create --name kaolin python=3.7
$ conda activate kaolin
We recommend following instructions from https://pytorch.org for installing PyTorch, and https://cython.readthedocs.io for installing cython, however Kaolin installation will attempt to automatically install the latest compatible version if none is installed (may fail on some systems).
Kaolin may also function with some incompatible PyTorch versions; to override the PyTorch version check, set environment variable export IGNORE_TORCH_VER=1
before installing.
To install the library. You must first clone the repository:
$ git clone --recursive https://github.com/NVIDIAGameWorks/kaolin
$ cd kaolin
If instead of the latest version you want a specific release like 0.10.0, 0.9.0, 0.9.1 or 0.1 you can then select the tag, example:
$ git checkout v0.10.0
To enable installation of experimental features, set
environment variable
export KAOLIN_INSTALL_EXPERIMENTAL=1
. To install, run:
Note
On CUDA >= 11.0, CUB is already available and CUB_HOME
should be specified to avoid conflict with the submodule third_party/cub
(typically on linux export CUB_HOME=/usr/local/cuda-*/include/
).
$ python setup.py develop
Note
If you are using heterogeneous GPUs setup set the architectures for which you want to compile the cuda code using the TORCH_CUDA_ARCH_LIST
environment variable.
Example:
$ export TORCH_CUDA_ARCH_LIST="7.0 7.5"
Note
Kaolin can be installed without GPU, however, CPU support is limited to some ops.
Testing your installation¶
A quick test is to see if you can properly import kaolin and print the current version by running the following:
$ python -c "import kaolin; print(kaolin.__version__)"
Running tests¶
A more exhaustive test is to execute all the official tests.
First, pytest dependencies are necessary to run those tests, to install those run:
$ pip install -r tools/ci_requirements.txt
Then run the tests as following:
$ pytest tests/python/
Note
These tests rely on cuda operations and will fail if you installed on CPU only, where not all functionality is available.