espnet: Docker build error

error content

I got the error while building docker image I run these commands.

  • command
cd docker
./build.sh fully_local cpu

but the error was occared.

  • the error sentence
Step 14/16 : RUN if [ -z "$( nvcc -V )" ]; then         echo "Build without CUDA" &&         MY_OPTS="CUPY_VERSION=";     else         echo "Build with CUDA" &&         export CFLAGS="-I${CUDA_HOME}/include ${CFLAGS}" &&         MY_OPTS="CUDA_VERSION=${CUDA_VER}" &&         sed -i 's|_install.py|_install.py --no-cuda|g' Makefile &&         sed -i 's|which nvidia-smi|which nvcc|g' Makefile;      fi;     if [ "${CUDA_VER}" = "10.1" ]; then         MY_OPTS="${MY_OPTS} TH_VERSION=1.3.1";      fi;     echo "Make with options ${MY_OPTS}";     make KALDI=/kaldi ${MY_OPTS}
 ---> Running in 59da3674b2df
/bin/sh: 1: nvcc: not found
Build without CUDA
Make with options CUPY_VERSION=
expr: syntax error
test -f kaldi/egs/wsj/s5/utils/parse_options.sh || { echo -e "Error: Put Kaldi here!\n    $ ln -s <kaldi-root> kaldi"; exit 1; }
-e Error: Put Kaldi here!
    $ ln -s <kaldi-root> kaldi
Makefile:65: recipe for target 'kaldi' failed
make: *** [kaldi] Error 1
The command '/bin/sh -c if [ -z "$( nvcc -V )" ]; then         echo "Build without CUDA" &&         MY_OPTS="CUPY_VERSION=";     else         echo "Build with CUDA" &&         export CFLAGS="-I${CUDA_HOME}/include ${CFLAGS}" &&         MY_OPTS="CUDA_VERSION=${CUDA_VER}" &&         sed -i 's|_install.py|_install.py --no-cuda|g' Makefile &&         sed -i 's|which nvidia-smi|which nvcc|g' Makefile;      fi;     if [ "${CUDA_VER}" = "10.1" ]; then         MY_OPTS="${MY_OPTS} TH_VERSION=1.3.1";      fi;     echo "Make with options ${MY_OPTS}";     make KALDI=/kaldi ${MY_OPTS}' returned a non-zero code: 2

My environment:

OS: macOS Catalina. (I also tried on Ubuntu18.04, but the error was also happend.)

I followed the error message, but other error occared.

I tried to add the command to Dokcerfile, but other error occard.

  • added the command to docker/prebuilt/local/Dockerfile
RUN ln -s /kaldi kaldi
  • another error
Step 15/17 : RUN if [ -z "$( nvcc -V )" ]; then         echo "Build without CUDA" &&         MY_OPTS="CUPY_VERSION=";     else         echo "Build with CUDA" &&         export CFLAGS="-I${CUDA_HOME}/include ${CFLAGS}" &&         MY_OPTS="CUDA_VERSION=${CUDA_VER}" &&         sed -i 's|_install.py|_install.py --no-cuda|g' Makefile &&         sed -i 's|which nvidia-smi|which nvcc|g' Makefile;      fi;     if [ "${CUDA_VER}" = "10.1" ]; then         MY_OPTS="${MY_OPTS} TH_VERSION=1.3.1";      fi;     echo "Make with options ${MY_OPTS}";     make KALDI=/kaldi ${MY_OPTS}
 ---> Running in fabc99f97da5
Build without CUDA
Make with options CUPY_VERSION=
/bin/sh: 1: nvcc: not found
expr: syntax error
test -f activate_python.sh || { echo "Error: Run ./setup_python.sh or ./setup_anaconda.sh"; exit 1; }
Error: Run ./setup_python.sh or ./setup_anaconda.sh
Makefile:68: recipe for target 'activate_python.sh' failed
make: *** [activate_python.sh] Error 1
The command '/bin/sh -c if [ -z "$( nvcc -V )" ]; then         echo "Build without CUDA" &&         MY_OPTS="CUPY_VERSION=";     else         echo "Build with CUDA" &&         export CFLAGS="-I${CUDA_HOME}/include ${CFLAGS}" &&         MY_OPTS="CUDA_VERSION=${CUDA_VER}" &&         sed -i 's|_install.py|_install.py --no-cuda|g' Makefile &&         sed -i 's|which nvidia-smi|which nvcc|g' Makefile;      fi;     if [ "${CUDA_VER}" = "10.1" ]; then         MY_OPTS="${MY_OPTS} TH_VERSION=1.3.1";      fi;     echo "Make with options ${MY_OPTS}";     make KALDI=/kaldi ${MY_OPTS}' returned a non-zero code: 2

After that, I tried to fix more following the error message, but error was still existed.

  • added the command to docker/prebuilt/local/Dockerfile
RUN ./setup_python.sh $(which python3)
  • another error
Step 15/18 : RUN ./setup_python.sh $(which python3)
 ---> Running in 83f7d133da5d
/usr/bin/pip3 doesn't exist.
The command '/bin/sh -c ./setup_python.sh $(which python3)' returned a non-zero code: 1

I tried to fix and build was successed but installing ESPNet was imcomplete

  • added the command to docker/prebuilt/local/Dockerfile
RUN ./setup_anaconda.sh

After that, building images is sccessed with no error. but there are not all of content in ESPNet e.g. espnet/espnet, espnet/utils and espnet/egs etc. are not existed.

ls espnet
CONTRIBUTING.md  README.md  doc   espnet.egg-info  setup.cfg  test_utils
LICENSE          ci         egs2  espnet2          setup.py   tools

If someone knows how to fix it, please advice me.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@Fhrozen Now I finished checking building docker image with CUDA after rollback to your commit 02d65dd. it worked without problem as you said, so I suppose the commits after yours cause the error https://github.com/espnet/espnet/issues/2508#issuecomment-698730667.

Thank you for all of your support and kindness.