Install NVENC 12.x with libnvidia-compute-server-525

I hope this is the right place for this. I’m rather a naive user.

Description

After successfully building HandBrakeCLI from source, it says

[12:08:57] nvenc: version 12.0 is available

I have a [NVIDIA GeForce GTX 1060 3GB].
If I’m reading this right, I’m getting my nvenc from libnvidia-encode-525-server which is coming as part of the compute library I have installed for the benefit of Folding@Home. For some reason it does not include nvenc 12.0 or 12.1.

Is it possible or safe to install the latest, greatest nvenc “on top of” or “alongside” the 525-server for the benefit of HandBrake and ffMPEG?

How would I do that? Is there a reliable APT Repository that would have it? Some other way?

Steps to reproduce the problem:

Build HandBrakeCLI from sources, then

HandBrakeCLI --version
[12:08:57] Compile-time hardening features are enabled
[12:08:57] nvenc: version 12.0 is available
[12:08:57] nvdec: is not compiled into this build
[12:08:57] CUDA Version: 6.1
[12:08:57] hb_init: starting libhb thread
[12:08:57] thread 7fd655fff640 started ("libhb")
HandBrake 1.7.1

HandBrake has exited.

HandBrake version: 1.7.1
Operating system and version: Ubuntu Linux 22.04

I think it has to do with the NVIDIA libraries on the machine.

apt list --installed libnvidia*
Listing… Done
libnvidia-cfg1-525-server/jammy-updates,jammy-security,now 525.147.05-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-compute-525-server/jammy-updates,jammy-security,now 525.147.05-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-container-tools/bionic,now 1.13.5-1 amd64 [installed]
libnvidia-container1/bionic,now 1.13.5-1 amd64 [installed]
libnvidia-decode-525-server/jammy-updates,jammy-security,now 525.147.05-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-encode-525-server/jammy-updates,jammy-security,now 525.147.05-0ubuntu0.22.04.1 amd64 [installed]

There’s nothing you need to install. the message

nvenc: version 12.0 is available

just means it’s already functional.

1 Like

just means it’s already functional

Thank you so much – I missed that; I thought it was complaining about my being behind the curve. Which is true, but…

OK, one step at a time.

Apparently I need version 12.1 but I have 12.0

I don’t quite know what this means but I guess the latest NVIDIA Driver in the “official” Ubuntu repository is a point-release behind with respect to building the very latest HandBrake.

I could PROBABLY build an earlier version of HandBrake (from sources) but that seems a little silly if I’m going to all this trouble. Or I could install the latest NVIDIA driver and hope it doesn’t break Folding@Home. But that’s a volunteer thing, so I’d just let them know…

Have I got this right?
What’s the best way to install the NVIDIA 525 driver that HandBrake/ffmpeg need?

HandBrakeCLI output

> [12:06:59] sync: expecting 168598 video frames
> [12:06:59] encavcodecInit: H.265 (Nvidia NVENC)
> [12:06:59] encavcodec: encoding at rc=vbr, 28.00
> [12:06:59] encavcodec: encoding with stored aspect 1/1
> [hevc_nvenc @ 0x7f12c409de80] Driver does not support the required nvenc API ver
> sion. Required: 12.1 Found: 12.0
> [hevc_nvenc @ 0x7f12c409de80] The minimum required Nvidia driver for nvenc is (u
> nknown) or newer
> [12:06:59] encavcodecInit: avcodec_open failed
> ERROR: Failure to initialise thread 'FFMPEG encoder (libavcodec)'
...
> [12:06:59] Finished work at: Fri Dec 15 12:06:59 2023
> 
> [12:06:59] libhb: work result = 3

nvidia-smi output

root@svr2:~# nvidia-smi
Fri Dec 15 12:24:41 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.147.05   Driver Version: 525.147.05   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name

ffmpeg output
Shows library versions

root@svr2:~# ffmpeg -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i <stuff> 
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[h264 @ 0x560a1c0d5b00] Invalid NAL unit 0, skipping.
[h264 @ 0x560a1c0d5b00] Error decoding the extradata
[h264 @ 0x560a1c0d5b00] Invalid NAL unit size (0 > 5170).
[h264 @ 0x560a1c0d5b00] Error splitting the input into NAL units.
... <many other things I don't understand but probably aren't important right now>

I guess the Handbrake version you’re running needs an nvidia driver 535 or higher, please upgrade.

1 Like