How do I install NVIDIA Video Codec SDK 8.1 in Ubuntu 16.04?

How do I install NVIDIA Video Codec SDK 8.1? I am using Ubuntu 16.04.4 LTS with CUDA 9.0.176 installed and NVIDIA Driver 390.30. I have a NVIDIA Geforce GTX 1050 (Notebook) GPU which supposedly supports NVIDIA Video Codec SDK 8.1 as mentioned on the website. I successfully built ffmpeg from git.ffmpeg.org Git - ffmpeg.git/summary as mentioned on the site regarding ffmpeg. However, I wasn’t able to make the NVIDIA Video Codec SDK samples in the Samples folder. The make command is simply

make

The error says that

g++ -std=c++11 -o AppDec AppDec.o NvDecoder.o -ldl -lcuda -lnvcuvid -L/usr/local/lib -lavformat -lm -lavcodec -pthread -lm -ldl -lswresample -lm -lavutil -pthread -lm -ldl
/usr/bin/ld: cannot find -lnvcuvid

which suggests that nvcuvid cannot be found. I tried to copy nvcuvid.h from Samples/NvCodec/NvDecoder/ to /usr/local/cuda-9.0/include. The same error still appeared.

I need to use NVIDIA Video Codec SDK as part of an educational assignment regarding NVIDIA Deepstream SDK which I have also been unable to install.

Hi Krismath,

libnvcuvid is part of the NVIDIA driver. Depending on how the driver was installed (driver from NVIDIA website vs ubuntu repository) you can find the library in /usr/lib/x86_64-linux-gnu or in another directory.

Please use

locate libnvcuvid

to find the directory where libnvcuvid is located and add this directory to the LIBRARY_PATH environment variable.

Best regards
Stefan

I am sorry,but that one doesn’t work. I am getting “undefined reference” error for all nvcuvid methods. There is no static lib provided with the driver (396)

I was able to link in /usr/lib/nvidia-396/libnvcuvid.so which contains the function definitions for everything in the NVIDIA 8.1 Video SDK. You also need to link in cuda for things like calling cuInit(0);

Your linker output should have…
/usr/lib/nvidia-396/libnvcuvid.so -lcuda

Hopefully that solves your problem. Always check the linker output to verify it’s actually linking in what you think it is.

So,
how to install the NVIDIA Video Codec SDK 8.1 after make?
I have read the readme and find nothing helped

Did you solved this problem? please

Hi comeon,
Are you running into any issues? Can you describe your problem in detail with exact steps, so that others can reproduce the same to help you better.

Thanks.