Installation¶
ChainerX, or chainerx
, can be installed as a top level Python package along with Chainer by configuring the environment variables below.
Note
Chainer must currently be installed from source in order to include ChainerX, but this is expected to change in the near future.
Installing from source¶
The following environment variables are available for building ChainerX from source.
Environment variable |
Description |
---|---|
|
|
|
|
|
|
|
|
Simply run pip install chainer
after configuring the above environment variables.
See Examples below.
CUDA support¶
When installing with the CUDA support, you also need to specify the cuDNN installation path.
You can specify either of the following environment variables to specify where to look for cuDNN installation.
Environment variable |
Description |
---|---|
|
Path to your cuDNN installation. |
|
|
To support the NumPy/CuPy fallback mechanism, currently ChainerX with the CUDA support requires CuPy to be installed together.
See also
Examples¶
Install ChainerX without CUDA support:
$ export CHAINER_BUILD_CHAINERX=1
$ export MAKEFLAGS=-j8 # Using 8 parallel jobs.
$ pip install chainer
Install ChainerX depending on CuPy wheel distribution:
$ pip install cupy_cuda101 # Note: Choose the proper CUDA SDK version number.
$ export CHAINER_BUILD_CHAINERX=1
$ export CHAINERX_BUILD_CUDA=1
$ export CHAINERX_CUDNN_USE_CUPY=1
$ export MAKEFLAGS=-j8 # Using 8 parallel jobs.
$ pip install chainer
Install ChainerX with CuPy built from source:
$ export CHAINER_BUILD_CHAINERX=1
$ export CHAINERX_BUILD_CUDA=1
$ export CUDNN_ROOT_DIR=path/to/cudnn
$ export MAKEFLAGS=-j8 # Using 8 parallel jobs.
$ pip install cupy
$ pip install chainer