C B*_*dge 6 apt ffmpeg cuda 16.04
在运行 16.04 的相当旧的笔记本电脑上,每当我尝试使用 ffmpeg 时,都会出现以下错误:
$ ffmpeg
ffmpeg: error while loading shared libraries: libcudart.so.5.5: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
ffmpeg used to work fine and broke at some point. I can't be sure exactly when, but it might well have been when I upgraded from 14.04 to 16.04.
Running ldd confirms that this library (the CUDA runtime library) is missing, but everything else is fine:
$ ldd /usr/bin/ffmpeg | grep libcudart
libcudart.so.5.5 => not found
Run Code Online (Sandbox Code Playgroud)
I am fairly sure that the file (libcudart5.5) does not exist anywhere on my system (I have tried `find' etc), or indeed any other version of libcudart. The closest thing in the repo to what I need is libcudart7.5, a later version. But this comes along with an nvidia driver upgrade (nvidia-367) as a dependency which I have found several times now tanks the whole system (due to the graphics card being a bit out of date I think).
So basically I'm confused as to why ffmpeg is trying to link to libcudart5.5 in the first place. Surely it should be possible to run ffmpeg without needing GPU support? In fact I know it is because on another computer I use running 16.04, ldd shows no dependency on any version of libcudart and ffmpeg works just fine. The version of the ffmpeg package is the same in both cases:
$ dpkg -s ffmpeg | grep Version
Version: 7:2.8.11-0ubuntu0.16.04.1
Run Code Online (Sandbox Code Playgroud)
那么为什么它会在我的笔记本电脑上寻找它呢?我试过清除 ffmpeg 并重新安装几次,但都没有成功。似乎相关的一件事是,我residual-config
在我的系统上找到了一个名为 libcudart5.5 的包的条目。我真的不知道这意味着什么,但是在删除它并重新安装 ffmpeg 之后,它没有任何区别。在某个阶段(在 14.04 下)我安装了完整的 CUDA sdk,但随后将其完全删除并且不想重新安装它,这也可能是相关的。
我真的很感激任何帮助,因为我真的很想在我的笔记本电脑上使用 ffmpeg 进行视频转换,这已经困扰了我一段时间了。
谢谢!
在受到里吉对原始问题的评论启发的一些调查之后,我正在回答我自己的问题(谢谢!)。我开始探索 ffmpeg 使用的其他一些库是否将 libcudart 作为依赖项。lddtree
包中的工具pax-utils
对此非常有帮助,因为它为您提供了链接器依赖项的分层列表而不是平面列表。例如
$ lddtree /usr/bin/ffmpeg
Run Code Online (Sandbox Code Playgroud)
使用它,我发现这libcudart.so.5.5
是一个链接器依赖项,libopencv_core.so.2.4
它的链接器依赖项/usr/local/lib
在我从源代码编译 OpenCV 2.4 时一直存在,并且在新版本(3.0 版)出现时从未清理过。
为了解决这个问题,我卸载了ffmpeg
所有opencv
使用apt包,然后手动删除剩余的OpenCV的2.4文件中/usr/local/lib
使用
$ sudo rm /usr/local/lib/libopencv_*.so.2.4*
Run Code Online (Sandbox Code Playgroud)
然后从 repo 重新安装 ffmpeg,现在一切都很好。
这似乎是一组相当具体的情况,可能与其他人无关,但也许这个答案对其他有类似问题的人有用。
归档时间: |
|
查看次数: |
6301 次 |
最近记录: |