安装CUDA 8.0后运行CUDA示例失败 [英] Failure in running CUDA sample after cuda 8.0 installation

查看:610
本文介绍了安装CUDA 8.0后运行CUDA示例失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#axzz4aZ4Q3q7v

然后执行确认测量。之后,我运行make并遇到如下所示的错误。

Then execute the confirmation measurement. After that, I run the make and bump into erros like the following.

$ make

...

nvcc警告: compute_20, sm_20和 sm_21体系结构已弃用,并且可能在以后的版本中删除(使用-Wno-deprecated- gpu-targets以禁止警告)。 / usr / bin / ld:找不到-lnvcuvid

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). /usr/bin/ld: cannot find -lnvcuvid

collect2:错误:ld返回1个退出状态

collect2: error: ld returned 1 exit status

Makefile:381:目标'cudaDecodeGL'的配方失败

Makefile:381: recipe for target 'cudaDecodeGL' failed

make [1]:*** [cudaDecodeGL]错误1

make[1]: *** [cudaDecodeGL] Error 1

make [1]:离开目录'/home/cocadas/Workspace/NVIDIA_CUDA-8.0_Samples/3_Imaging/cudaDecodeGL'

make[1]: Leaving directory '/home/cocadas/Workspace/NVIDIA_CUDA-8.0_Samples/3_Imaging/cudaDecodeGL'

Makefile:52:目标配方'3_Imaging / cudaDecodeGL / Makefile.ph_build'失败:*** [3_Imaging / cudaDecodeGL / Makefile.ph_build]错误2

Makefile:52: recipe for target '3_Imaging/cudaDecodeGL/Makefile.ph_build' failed make: *** [3_Imaging/cudaDecodeGL/Makefile.ph_build] Error 2

然后,我检查了系统信息

Then, I checked the information of the system

环境$ printenv路径/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/ usr / bin:/ sbin:/ bin:/ usr / games:/ usr / local / games:/ snap / bin:/ usr / lib / jvm / java-8-oracle / bin:/ usr / lib / jvm / java -8-oracle / db / bin:/ usr / lib / jvm / java-8-oracle / jre / bin:/ home / cocadas / Program / android-studio / bin

Environment $ printenv PATH /usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/cocadas/Program/android-studio/bin

$ echo $ LD_LIBRARY_PATH /usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/lib64

$ echo $LD_LIBRARY_PATH /usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/lib64

OS $ uname -m x86_64

OS $ uname -m x86_64

$ uname -r 4.4.0-64-generic

$ uname -r 4.4.0-64-generic

其他

$ lspci | grep -i nvidia 01:00.0 VGA兼容控制器:NVIDIA Corporation GK107GLM [Quadro K1100M](rev a1)

$ lspci |grep -i nvidia 01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K1100M] (rev a1)

$ gcc --version

$ gcc --version

gcc(Ubuntu 5.4.0-6ubuntu1〜16.04.4)5.4.0 20160609版权所有(C)2015 Free Software Foundation,Inc.这是免费软件;请参阅复制条件的来源。没有保修;甚至不是出于适销性或针对特定目的的适用性。 $ sudo apt-get install linux-headers-$(uname -r)[sudo] cocadas的密码:读取软件包列表...完成构建依赖树
读取状态信息...完成linux-headers-4.4。 0-64-generic已经是最新版本(4.4.0-64.85)。 linux-headers-4.4.0-64-generic设置为手动安装。以下软件包是自动安装的,不再需要:linux-headers-4.4.0-53 linux-headers-4.4.0-53-generic linux-image-4.4.0-53-generic linux-image-extra-4.4 .0-53-generic使用'sudo apt autoremove'删除它们。 0已升级,0新安装,0已删除和99未升级。

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ sudo apt-get install linux-headers-$(uname -r) [sudo] password for cocadas: Reading package lists... Done Building dependency tree Reading state information... Done linux-headers-4.4.0-64-generic is already the newest version (4.4.0-64.85). linux-headers-4.4.0-64-generic set to manually installed. The following packages were automatically installed and are no longer required: linux-headers-4.4.0-53 linux-headers-4.4.0-53-generic linux-image-4.4.0-53-generic linux-image-extra-4.4.0-53-generic Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 99 not upgraded.

$ cat / proc / driver / nvidia / version NVRM版本:NVIDIA UNIX x86_64内核模块375.26 Thu Dec 8 18:36:43 PST 2016 GST版本:gcc版本5.4 .0 20160609(Ubuntu 5.4.0-6ubuntu1〜16.04.4)

$ cat /proc/driver/nvidia/version NVRM version: NVIDIA UNIX x86_64 Kernel Module 375.26 Thu Dec 8 18:36:43 PST 2016 GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

$ nvcc -V nvcc:NVIDIA(R)Cuda编译器驱动程序版权所有(c)2005-2016 NVIDIA Corporation基于Tue_Jan_10_13:22:03_CST_2017 Cuda编译工具,版本8.0,V8.0.61

$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61

那么,我还能尝试什么?

So, what else can I try?

推荐答案

根本原因是链接器找不到libnvcuvid,而make文件的驱动程序版本应为375(如文章中所示)。因此,在文件夹中使用以下命令

The root cause is the linker can't find libnvcuvid and driver version of make file shall be 375 (as shown in the post). Therefore, use the following command in the folder

~/NVIDIA_CUDA-8.0_Samples/$find . -type f -execdir sed -i 's/UBUNTU_PKG_NAME = "nvidia-367"/UBUNTU_PKG_NAME = "nvidia-375"/g' '{}' \;

这篇关于安装CUDA 8.0后运行CUDA示例失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆