command ‘:/usr/local/cuda/bin/nvcc‘ failed with exit status 1

2022-09-02 20:23:47 浏览数 (2)

command ‘:/usr/local/cuda/bin/nvcc’ failed with exit status 1

代码语言:javascript复制
unable to execute ':/usr/local/cuda/bin/nvcc': No such file or directory
error: command ':/usr/local/cuda/bin/nvcc' failed with exit status 1

提示找不到 nvcc, 但是输入 nvcc --version, 却可以正常显示:

代码语言:javascript复制
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

仔细观察发现, 报错的路径里面多了一个冒号!!

代码语言:javascript复制
unable to execute ':/usr/local/cuda/bin/nvcc': No such file or directory

因此, 说明是环境变量的设置有问题, 将~/.zshrc(或者~/.bashrc)中进行如下修改

代码语言:javascript复制
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda
# 将上面的语句修改成:
export CUDA_HOME=/usr/local/cuda

然后, 刷新shell

代码语言:javascript复制
exec $SHELL$

接着, 删掉旧文件重新build

代码语言:javascript复制
rm -rf build
python setup.py  build develop

0 人点赞