PyTorch Build from Source - Non-zero exit status 1

Hello everyone,

I am trying to use Tesla K20M. Since it has 3.x compute capability, I have to install PyTorch from source. I am following instructions on [1]. I installed Cuda 10.0 and Cudnn 7.6 with Anaconda. When I tried to run “python install” command, I got an error.

– Configuring incomplete, errors occurred!
See also “…/pytorch/build/CMakeFiles/CMakeOutput.log”.
See also “…/pytorch/build/CMakeFiles/CMakeError.log”.
Traceback (most recent call last):
File “”, line 737, in
File “”, line 316, in build_deps
File “…/pytorch/tools/”, line 59, in build_caffe2
File “…/pytorch/tools/setup_helpers/”, line 325, in generate, env=my_env)
File “…/pytorch/tools/setup_helpers/”, line 141, in run
check_call(command, cwd=self.build_dir, env=env)
File “…/miniconda3/envs/conda_pytorch/lib/python3.7/”, line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘-GNinja’, ‘-DBUILD_PYTHON=True’, ‘-DBUILD_TEST=True’, ‘-DCMAKE_BUILD_TYPE=Release’, ‘-DCMAKE_INSTALL_PREFIX=…/pytorch/torch’, ‘-DCMAKE_PREFIX_PATH=…/miniconda3/envs/conda_pytorch’, ‘-DNUMPY_INCLUDE_DIR=…/miniconda3/envs/conda_pytorch/lib/python3.7/site-packages/numpy/core/include’, ‘-DPYTHON_EXECUTABLE=…/miniconda3/envs/conda_pytorch/bin/python’, ‘-DPYTHON_INCLUDE_DIR=…/miniconda3/envs/conda_pytorch/include/python3.7m’, ‘-DPYTHON_LIBRARY=…/miniconda3/envs/conda_pytorch/lib/’, ‘-DTORCH_BUILD_VERSION=1.5.0a0+3655975’, ‘-DUSE_NUMPY=True’, ‘…/pytorch’]’ returned non-zero exit status 1.

Since I am using the server in my company, I can only install something in my virtual environment. Besides, the GCC version of the system is 4.8.4.

Could you please give me any suggestions? Thank you.



To build PyTorch from source with CUDA support, you would need a local CUDA and cudnn installation.
The runtime from conda shouldn’t be sufficient to build.

Thank you for the response. Unfortunately I cannot install CUDA and cudnn to out of the virtual environment. Because it is not my personal computer. So, is there any other way to install PyTorch with CUDA support on this system?

You could use docker and derive the base container from one with CUDA.

1 Like