Nvidia nvcc -v 未安装

Nvidia nvcc -v 未安装

我安装cuda-repo-ubuntu1604-8-0-local在 Ubuntu 16.10 上。当我在 python 中导入 tensorflow 时,一切似乎都很好:

Python 2.7.12+ (default, Sep 17 2016, 12:08:02) 
[GCC 6.2.0 20160914] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally

但是当我尝试时,我得到了以下信息nvcc -v。我还尝试安装 Chainer 框架,但它说找不到nvcc

nvcc -v
/usr/bin/nvcc: line 1: /bin: Is a directory
/usr/bin/nvcc: line 2: cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64.deb: command not found
/usr/bin/nvcc: line 3: cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64.deb: command not found
/usr/bin/nvcc: line 4: cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64.deb: command not found
/usr/bin/nvcc: line 5: cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64.deb: command not found
/usr/bin/nvcc: line 6: syntax error near unexpected token `('
/usr/bin/nvcc: line 6: ` * This source code and/or documentation ("Licensed Deliverables") are'

输出nvcc -v正常吗?我猜是的。如何正确安装 nvcc?

答案1

您需要添加库达/home/username/.bashrc设置 CUDA 环境的文件路径:

export CUDA_HOME=/usr/local/cuda-7.5 
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 

PATH=${CUDA_HOME}/bin:${PATH} 
export PATH 

请将版本号更改为您和source您的/home/username/.bashrc文件的版本号。

来源:

http://www.r-tutor.com/gpu-computing/cuda-installation/cuda7.5-ubuntu

相关内容