我是Ubuntu的新手,我正在尝试在其上安装CUDA。我无法做到。
我安装了Nvidia R390驱动程序(非常简单)。
然后我按照说明:
http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
当我点击sudo apt-get install cuda
弹出以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
cuda-cublas-dev-9-1 : Depends: cuda-cublas-9-1 (>= 9.1.85.3) but it is not installed
cuda-cufft-dev-9-1 : Depends: cuda-cufft-9-1 (>= 9.1.85) but it is not installed
cuda-curand-dev-9-1 : Depends: cuda-curand-9-1 (>= 9.1.85) but it is not installed
cuda-cusolver-dev-9-1 : Depends: cuda-cusolver-9-1 (>= 9.1.85) but it is not installed
cuda-cusparse-dev-9-1 : Depends: cuda-cusparse-9-1 (>= 9.1.85) but it is not installed
cuda-libraries-9-1 : Depends: cuda-nvrtc-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-nvgraph-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cusolver-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cublas-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cufft-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-curand-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-cusparse-9-1 (>= 9.1.85) but it is not installed
Depends: cuda-npp-9-1 (>= 9.1.85) but it is not installed
cuda-npp-dev-9-1 : Depends: cuda-npp-9-1 (>= 9.1.85) but it is not installed
cuda-nvgraph-dev-9-1 : Depends: cuda-nvgraph-9-1 (>= 9.1.85) but it is not installed
cuda-nvrtc-dev-9-1 : Depends: cuda-nvrtc-9-1 (>= 9.1.85) but it is not installed
cuda-toolkit-9-1 : Depends: cuda-nvml-dev-9-1 (>= 9.1.85) but it is not installed
cuda-visual-tools-9-1 : Depends: cuda-nvml-dev-9-1 but it is not installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
所以我使用sudo apt-get -f install,但发生了以下错误:
Preparing to unpack .../cuda-nvrtc-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-nvrtc-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-nvrtc-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Preparing to unpack .../cuda-cusolver-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-cusolver-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cusolver-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Preparing to unpack .../cuda-cublas-9-1_9.1.85.3-1_amd64.deb ...
Unpacking cuda-cublas-9-1 (9.1.85.3-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Preparing to unpack .../cuda-cufft-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-cufft-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cufft-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-curand-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-curand-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-curand-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-cusparse-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-cusparse-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cusparse-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-npp-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-npp-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-npp-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-nvml-dev-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-nvml-dev-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-nvml-dev-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Preparing to unpack .../cuda-nvgraph-9-1_9.1.85-1_amd64.deb ...
Unpacking cuda-nvgraph-9-1 (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-nvgraph-9-1_9.1.85-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
/var/cache/apt/archives/cuda-nvrtc-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-cusolver-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb
/var/cache/apt/archives/cuda-cufft-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-curand-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-cusparse-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-npp-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-nvml-dev-9-1_9.1.85-1_amd64.deb
/var/cache/apt/archives/cuda-nvgraph-9-1_9.1.85-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
有人可以帮忙吗?我的想法已经不多了。谢谢!
答案 0 :(得分:2)
然后停止X显示管理器(lightdm是ubuntu的默认设置)
sudo service lightdm stop
安装显示驱动程序(推荐)和CUDA TOOLKIT
sudo chmod +x cuda_9.0_linux.run
sudo ./cuda_9.0_linux.run
POST-INSTALL(将这些行添加到.bashrc
文件的末尾)
export CUDA_HOME=/usr/local/cuda-9.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
PATH=${CUDA_HOME}/bin:${PATH}
export PATH
CUDNN INSTALL(可选)
从HERE
获取CUDNN内容tar -xzvf cudnn-X.Y.tgz
cd cudnn-X.Y/cuda
sudo cp -r * /usr/local/cuda-9.0
sudo ldconfig
请记住检查您要安装的tensorflow版本支持哪些版本的cuda和cudnn。 (例如cuda9.0,cudnn7 for tensorflow 1.7,这是我写这个答案时的最新版本)
答案 1 :(得分:0)
我没有复制问题,但是您的跟踪表明/ boot分区空间不足。尝试清除一些旧内核,然后重新运行该命令。您的安装应该正常恢复。我希望有帮助:)