Skip to content

Commit

Permalink
use cpu unless nvidia-smi available
Browse files Browse the repository at this point in the history
  • Loading branch information
ShigekiKarita authored Apr 19, 2019
1 parent 9ad0369 commit 1f758b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ python: venv cupy.done chainer_patch.done warp-ctc.done chainer_ctc.done

extra: nkf.done sentencepiece.done mecab.done moses.done

ifeq (($shell which nvidia-smi),) # No 'nvcc' found
CONDA_PYTORCH := pytorch=$(TH_VERSION) cudatoolkit=$(CUDA_VERSION)
else
CONDA_PYTORCH := pytorch-cpu=$(TH_VERSION)
endif

ifneq ($(strip $(KALDI)),)
kaldi.done:
Expand Down Expand Up @@ -60,7 +65,7 @@ venv: miniconda.sh
. venv/bin/activate && conda install -y python=$(PYTHON_VERSION)
. venv/bin/activate && conda info -a
espnet.done: venv
. venv/bin/activate && conda install -y pytorch=$(TH_VERSION) cudatoolkit=$(CUDA_VERSION) -c pytorch
. venv/bin/activate && conda install -y $(CONDA_PYTORCH) -c pytorch
. venv/bin/activate && conda install -y matplotlib
. venv/bin/activate && pip install -e ..
touch espnet.done
Expand Down

0 comments on commit 1f758b5

Please sign in to comment.