From 1f758b5445dc8963d0785a612fae8c886342cc10 Mon Sep 17 00:00:00 2001 From: Shigeki Karita Date: Fri, 19 Apr 2019 20:32:39 +0900 Subject: [PATCH] use cpu unless nvidia-smi available --- tools/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 1e1fb464330..6c781a1f436 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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: @@ -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