-
-
Save saurabh-kataria/650496c4d550190c8683a93e4161b28e to your computer and use it in GitHub Desktop.
Steps needed to install K2 from scratch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Common steps | |
conda create -n k2 python=3.8 | |
conda activate k2 | |
conda install -c nvidia cudnn=7.6.5 cudatoolkit=10.2 | |
conda install -c pytorch pytorch torchaudio | |
pip install cmake | |
mkdir build | |
pushd build | |
CONDA_ROOT="$(conda config --show root_prefix | cut -f2 -d' ')" | |
CONDA_ENV_DIR="$CONDA_ROOT/envs/k2" | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_CUDA_COMPILER=$(which nvcc) \ | |
-DPYTHON_EXECUTABLE=$(which python) \ | |
-DCUDNN_LIBRARY_PATH=$CONDA_ENV_DIR/lib/libcudnn.so \ | |
-DCUDNN_INCLUDE_PATH=$CONDA_ENV_DIR/include/ \ | |
.. | |
make -j24 _k2 | |
popd | |
# When updating and rebuilding K2, before executing these steps, run: | |
# rm -rf dist/ | |
scripts/build_pip.sh | |
pip install dist/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment