Nvidia toolkit + FFMPEG

(Marco Cipriano) #1

i’m trying to configure the nvidia toolkit for my parrot enviroment.
apt-get install nvidia-driver nvidia-cuda-toolkit
worked well to be able to develop with pytorch using GPUs but i’m stuck when trying to use my nvidia card as hw-accelerator for FFMPEG.

locate cuda | grep /cuda$
it came out that i have a cuda dir in /usr/lib/cuda/
containing folders: bin (empty!), include (empty!), lib64 (empty!) and nvvm.

my ffmpeg source comes from the official repo: https://github.com/FFmpeg/FFmpeg

i configured it as follows:
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/lib/cuda/include --extra-ldflags=-L/usr/lib/cuda/lib64
then i run:
make -j 10 as mentioned in the nvidia doc: https://developer.nvidia.com/ffmpeg

a simple ffmpeg command now, like
./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i ../test.MP4 -vf scale_npp=1280:720 -c:v h264_nvenc ../out.mp4

gives me the following errors
[h264_nvenc @ 0x55dd2bbbcac0] Cannot load libnvidia-encode.so.1 [h264_nvenc @ 0x55dd2bbbcac0] The minimum required Nvidia driver for nvenc is 418.30 or newer Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

is it maybe due to the empty folders in my nvidia dir?

should i change the way to install nvidia-toolkit or is there something simple i can do to fix this problem?


unlisted #2

Hey nice to see someone working with Pytorch. Unfortunately community isn’t the right place if you need support. Now that I’ve moved you here could you please review our support guidelines and fill them out so we know what system you’re working with?

(Marco Cipriano) #4

thanks for your reply.
as it often happens in our field, in few hours i have several news.

firstble i’ll try to answer to the guidelines questions:

What version of Parrot are you running?

Version 4.6, Security amd64.

What method did you use to install Parrot?

Debian Standard

Configured to multiboot with other systems?

on my laptop i’ve a 1TB disk for data,
one 256GB nvme SSD (windows)
one 128GB SSD (parrot)

here’s the most recent progresses

i uninstalled the cuda-toolkit as it appeared to work well but i wasn’t able to find any lib folder on my /usr directory as expected.
i tried to compile the toolkit from my own with the
runfile installer which is marked as “more compatible with other linux distros”
(i used the ubuntu 18.10 installer).
installation looks fine. I still have issues with some missing lib which should be linked to the nvidia-driver rather than the toolkit.
My nvidia driver version is currently the 418.56 installed through APT, i’m wondering about compiling this driver by my own as well.
i would love to have some suggestions about the best way to handle those graphic drivers on parrot.

listed #5