gpt4 book ai didi

c - 我已经安装了 Cuda 6.5,但 OpenCV 给出了有关 Cuda 6.0 的错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:57:19 24 4
gpt4 key购买 nike

我有 CUDA 6.0 和 OpenCV 2.4.8(用 CUDA 编译),我用它来了解它,然后我买了一个 Jetson TK-1。 NVIDIA 为 Tegra K1 发布了 R21.2 驱动包和 CUDA 6.5,我已经安装了 CUDA 6.5 并使用 CUDA 样本进行了测试,它们运行没有问题。之后我删除了 CUDA 6.0,样本仍在运行。我也安装了 OpenCV 的新版本 2.4.9,但我没有删除 2.4.8 共享库和 header 。我已经使用 ./build_all.sh 编译了所有 C 示例,所有这些都编译无误,但是当我想在 ../samples/c 目录中运行任何示例时示例 sudo ./contours 我遇到的问题是 ./contours:加载共享库时出错:libcudart.so.6.0:无法打开共享对象文件:没有这样的文件或目录 但当我检查 LD_LIBRARY_PATHPATHopencv.cv 文件和 PKG_CONFIG_PATH (这是对于正确的 opencv.cv 路径)我看不出有任何问题。我正在添加每个路径变量的 echo 输出;

echo $LD_LIBRARY_PATH
:/usr/local/cuda-6.5/lib:/usr/local/cuda-6.5/lib64:/usr/local/opencv-2.4.9/lib
echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/CodeSourcery/arm-2013.11/bin:/opt/STLink/stlink:/opt/R-Pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:/opt/CodeSourcery/arm-2013.11/bin:/usr/local/cuda-6.5/bin:/usr/local/cuda/bin
echo $PKG_CONFIG_PATH
/usr/local/opencv-2.4.9/lib/pkgconfig

opencv.pc 文件

# Package Information for pkg-config
prefix=/usr/local/opencv-2.4.9
exec_prefix=${prefix}
libdir=${prefix}
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include

Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.4.9
Libs: ${exec_prefix}/lib/libopencv_calib3d.so ${exec_prefix}/lib/libopencv_contrib.so ${exec_prefix}/lib/libopencv_core.so ${exec_prefix}/lib/libopencv_features2d.so ${exec_prefix}/lib/libopencv_flann.so ${exec_prefix}/lib/libopencv_gpu.so ${exec_prefix}/lib/libopencv_highgui.so ${exec_prefix}/lib/libopencv_imgproc.so ${exec_prefix}/lib/libopencv_legacy.so ${exec_prefix}/lib/libopencv_ml.so ${exec_prefix}/lib/libopencv_nonfree.so ${exec_prefix}/lib/libopencv_objdetect.so ${exec_prefix}/lib/libopencv_ocl.so ${exec_prefix}/lib/libopencv_photo.so ${exec_prefix}/lib/libopencv_stitching.so ${exec_prefix}/lib/libopencv_superres.so ${exec_prefix}/lib/libopencv_ts.a ${exec_prefix}/lib/libopencv_video.so ${exec_prefix}/lib/libopencv_videostab.so /usr/local/cuda/lib64/libcufft.so /usr/local/cuda/lib64/libnpps.so /usr/local/cuda/lib64/libnppi.so /usr/local/cuda/lib64/libnppc.so /usr/local/cuda/lib64/libcudart.so -ltbb /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so -lrt -lpthread -lm -ldl
Cflags: -I${includedir_old} -I${includedir_new}

为什么会这样?谢谢。

ldd ./contours
linux-vdso.so.1 => (0x00007fff89ffe000)
libopencv_core.so.2.4 => /usr/local/opencv-2.4.9/lib/libopencv_core.so.2.4 (0x00007f621a97c000)
libopencv_highgui.so.2.4 => /usr/local/opencv-2.4.9/lib/libopencv_highgui.so.2.4 (0x00007f621a6ec000)
libopencv_imgproc.so.2.4 => /usr/local/opencv-2.4.9/lib/libopencv_imgproc.so.2.4 (0x00007f621a21b000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6219efb000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6219b3b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6219924000)
libcudart.so.6.5 => /usr/local/cuda/lib64/libcudart.so.6.5 (0x00007f62196d4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f62194b6000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f62192ae000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f6218f62000)
libtbb.so.2 => /usr/lib/libtbb.so.2 (0x00007f6218d34000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6218a28000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6218811000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f62185c0000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f6218398000)
libtiff.so.4 => /usr/lib/x86_64-linux-gnu/libtiff.so.4 (0x00007f6218134000)
libjasper.so.1 => /usr/lib/x86_64-linux-gnu/libjasper.so.1 (0x00007f6217edc000)
libIlmImf.so.6 => /usr/lib/libIlmImf.so.6 (0x00007f6217c1b000)
libHalf.so.6 => /usr/lib/libHalf.so.6 (0x00007f62179d8000)
libdc1394.so.22 => /usr/lib/x86_64-linux-gnu/libdc1394.so.22 (0x00007f6217764000)
libv4l1.so.0 => /usr/lib/x86_64-linux-gnu/libv4l1.so.0 (0x00007f621755e000)
libavcodec.so.53 => /usr/lib/x86_64-linux-gnu/libavcodec.so.53 (0x00007f6216742000)
libavformat.so.53 => /usr/lib/x86_64-linux-gnu/libavformat.so.53 (0x00007f6216440000)
libavutil.so.51 => /usr/lib/x86_64-linux-gnu/libavutil.so.51 (0x00007f6216220000)
libswscale.so.2 => /usr/lib/x86_64-linux-gnu/libswscale.so.2 (0x00007f6215fda000)
libQtOpenGL.so.4 => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 (0x00007f6215cdb000)
libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f621500d000)
libQtTest.so.4 => /usr/lib/x86_64-linux-gnu/libQtTest.so.4 (0x00007f6214de7000)
libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f6214914000)
/lib64/ld-linux-x86-64.so.2 (0x00007f621ae44000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6214710000)
libnvidia-tls.so.340.58 => /usr/lib/tls/libnvidia-tls.so.340.58 (0x00007f621450c000)
libnvidia-glcore.so.340.58 => /usr/lib/libnvidia-glcore.so.340.58 (0x00007f62118f8000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f62115c3000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f62113b1000)
libImath.so.6 => /usr/lib/libImath.so.6 (0x00007f62111ab000)
libIex.so.6 => /usr/lib/libIex.so.6 (0x00007f6210f8b000)
libIlmThread.so.6 => /usr/lib/libIlmThread.so.6 (0x00007f6210d84000)
libraw1394.so.11 => /usr/lib/x86_64-linux-gnu/libraw1394.so.11 (0x00007f6210b75000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007f6210965000)
libv4l2.so.0 => /usr/lib/x86_64-linux-gnu/libv4l2.so.0 (0x00007f6210759000)
libxvidcore.so.4 => /usr/lib/x86_64-linux-gnu/libxvidcore.so.4 (0x00007f6210422000)
libx264.so.120 => /usr/lib/x86_64-linux-gnu/libx264.so.120 (0x00007f621009b000)
libvpx.so.1 => /usr/lib/libvpx.so.1 (0x00007f620fdf6000)
libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f620f927000)
libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f620f6fa000)
libvo-amrwbenc.so.0 => /usr/lib/x86_64-linux-gnu/libvo-amrwbenc.so.0 (0x00007f620f4df000)
libvo-aacenc.so.0 => /usr/lib/x86_64-linux-gnu/libvo-aacenc.so.0 (0x00007f620f2c0000)
libtheoraenc.so.1 => /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 (0x00007f620f082000)
libtheoradec.so.1 => /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 (0x00007f620ee67000)
libspeex.so.1 => /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007f620ec4e000)
libschroedinger-1.0.so.0 => /usr/lib/libschroedinger-1.0.so.0 (0x00007f620e99a000)
libopenjpeg.so.2 => /usr/lib/libopenjpeg.so.2 (0x00007f620e779000)
libmp3lame.so.0 => /usr/lib/x86_64-linux-gnu/libmp3lame.so.0 (0x00007f620e4ef000)
libgsm.so.1 => /usr/lib/libgsm.so.1 (0x00007f620e2e0000)
libdirac_encoder.so.0 => /usr/lib/libdirac_encoder.so.0 (0x00007f620e05a000)
libva.so.1 => /usr/lib/x86_64-linux-gnu/libva.so.1 (0x00007f620de44000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f620dc33000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f620d997000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f620d78c000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f620d556000)
libaudio.so.2 => /usr/lib/x86_64-linux-gnu/libaudio.so.2 (0x00007f620d33e000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f620d049000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f620cdf9000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f620cbf1000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f620c9d7000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f620c7c6000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f620c5a8000)
libv4lconvert.so.0 => /usr/lib/x86_64-linux-gnu/libv4lconvert.so.0 (0x00007f620c332000)
libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f620c12b000)
liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f620beaf000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f620bc85000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f620ba1e000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f620b81b000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f620b5de000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f620b3d5000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f620b1d0000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f620afca000)

最佳答案

为了安全,在 libcudart.so.6.5 和 libcudart.so.6.0 之间创建一个符号链接(symbolic link)。

sudo ln -s/usr/local/cuda/lib64/libcudart.so.6.5/usr/local/cuda/lib64/libcudart.so.6.0

关于c - 我已经安装了 Cuda 6.5,但 OpenCV 给出了有关 Cuda 6.0 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26931819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com