[FFmpeg-user] compiling ffmpeg for nvidia gpu under Debian Bullseye

Moritz Barsnick barsnick at gmx.net
Thu Feb 11 16:35:41 EET 2021


On Wed, Feb 10, 2021 at 13:53:32 -0500, Steve Newcomb wrote:
> about what happened and how I eventually succeeded.  (I did everything as
> superuser, so you won't see any "sudo" below.)

I do see sudo below. And I don't see any reason to do any steps beyond
installation as superuser or with sudo. Don't compile as root!

> cd nv-codec-headers && sudo make install && cd –
> This worked, but the final invocation of cd was uninterpretable due to the
> last character's being garbled (by my browser? or by Emacs?).  I followed
> this incantation with a "cd ..", which turned out to be the right thing to
> do.

In nvidia's instruction, the web code apparently inserted some fancy
dash '–' instead of the regular '-'.

> apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev
> This turned out not to be enough packages.  I ended up installing the following packages, as well, even if some of them may not be strictly necessary.
> I always install lots of utility packages which don't appear on this list, so this list, too, may not be complete:
> nvidia-detect
> nvidia-driver
> libnvidia-encode1
> libnppc11
> libnppial11
> libnppicc11
> libnppidei11
> libnppif11
> libnppig11
> libnppim11
> libnppist11
> libnppisu11
> libnppitc11
> libnpps11
> nvidia-cg-toolkit
> nvidia-cuda-gdb
> nvidia-cuda-toolkit
> nvidia-cuda-toolkit-gcc
> nvtop

These all look like nvidia's dependencies. Could it be that they are
part of the mentioned "CUDA toolkit", as listed under "Prerequisites"?
(Though if you can get them from the system repos, I think's that's
fine. Just perhaps not what nvidia wants you to do.)

> ./configure --enable-nonfree -–enable-cuda-sdk –enable-libnpp
> --extra-cflags=-I/usr/local/cuda/include
> --extra-ldflags=-L/usr/local/cuda/lib64
> This incantation had 2 problems.
>
> (1) --enable-cuda-sdk is an obsolete argument.  I changed it to --enable-cuda-nvcc
>
> (2) The configure failed with the report: "ERROR: failed checking for nvcc."  Why?
>     The configure script checks nvcc by passing itan obsolete architecture
> code, "compute_30", which modern nvcc does not support.  <https://stackoverflow.com/questions/64774548/unsupported-gpu-architecture-compute-30-on-a-cuda-5-capable-gpu>
> I edited the part of the configure script that says:
> if enabled cuda_nvcc; then
>     nvcc_default="nvcc"
>     nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
> else
>     nvcc_default="clang"
>     nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
>     NVCC_C=""
> fi
>     ...so it instead said:
> if enabled cuda_nvcc; then
>     nvcc_default="nvcc"
>     nvccflags_default="-gencode arch=compute_75,code=sm_75 -O2"
> else
>     nvcc_default="clang"
>     nvccflags_default="--cuda-gpu-arch=sm_75 -O2"
>     NVCC_C=""
> fi
>     ...although apparently it would have been fine to change "30" to "50" instead of "75" as I did.
>     Perhaps ffmpeg developers should make this change, or do something similar.

Indeed, perhaps ffmpeg developers need to look at this.

Did you give feedback to nvidia regarding their document?

Thanks,
cheers,
Moritz


More information about the ffmpeg-user mailing list