机器nvcc -V混淆上的多个CUDA版本 [英] Multiple CUDA versions on machine nvcc -V confusion
问题描述
我以前在计算机上安装了cuda-7.0,后来又卸载了cuda-7.0并安装了cuda-8.0。当我转到/ usr / local文件夹时,看到以下文件夹:
I used to have cuda-7.0 installed on my machine and later un-installed cuda-7.0 and installed cuda-8.0. When I go to my /usr/local folder I see the following folders:
/bin/
/cuda/
/cuda-7.0/
/cuda-8.0/
/etc/
/games/
/include/
/lib/
/lua/
/man/
/MATLAB/
/sbin/
/share/
/src/
我想我很困惑,因为/cuda/version.txt文件说它在cuda-8.0上,但是当我键入:
I guess I'm confused since the /cuda/version.txt file says it is on cuda-8.0, but when I type:
$ nvcc -V
它报告说我正在使用7.0版:
it reports that I'm using version 7.0:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Mon_Feb_16_22:59:02_CST_2015
Cuda compilation tools, release 7.0, V7.0.27
令我困惑的是,即使我这样做:
What still puzzles me is that even if I do:
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export PATH=$PATH:/usr/local/cuda-8.0/bin
在我键入 $ nvcc -V
之后,仍然会输出7.0版。
after I type $ nvcc -V
, it still outputs version 7.0.
编辑:
$ which nvcc
/usr/local/cuda-7.0/bin/nvcc
$ echo $PATH
/home/arturo/torch/install/bin:/home/arturo/torch/install/bin:/home/arturo/torch/install/bin:/home/arturo/torch/install/bin:/home/arturo/torch/install/bin:/home/arturo/torch/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/cuda-7.0/bin
推荐答案
评论中建议的解决方案:
Solution as suggested in the comments:
export PATH=/usr/local/cuda-8.0/bin:$PATH
问题是 $ PATH
的顺序,我的上一个命令的 = $ PATH:/ usr / local ...
而不是 = / usr / local ....:$ PATH
The problem was the ordering of $PATH
, that my previous command had the =$PATH:/usr/local...
instead of =/usr/local....:$PATH
这篇关于机器nvcc -V混淆上的多个CUDA版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!