NVIDA AGX ORIN X Gstreamer Bad Plug-Ins NVENC and NVDEC Cannot be downloaded

Hello, I have spent a considerable amount of time trying to download some requirements for GPU accelerated plugins for my Gstreamer pipeline. Effectively I need the nvenc and nvdec 264 however I cannot follow installation guidelines online which I will reference in further detail, nor did the plug-in(s) come with the CUDA Toolkit download. This has been a recurring issue and has caused a large delay in my project. Any guidance on how to complete this or how to fix existing issues would be helpful.

Specifications,

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Sun_Oct_23_22:16:07_PDT_2022
Cuda compilation tools, release 11.4, V11.4.315
Build cuda_11.4.r11.4/compiler.31964100_0

UBUNTU 20.4

HARDWARE NVIDIA JETSON AGX ORIN Developer Kit

Online References:

(1) GStreamer Nvenc for Ubuntu 20.04 | End Point Dev
fails at:

$ cd ../nvdec
$ make                    <- Fails here

CCLD libgstnvdec.la
/usr/bin/ld: cannot find -lnvcuvid
collect2: error: ld returned 1 exit status
make: *** [Makefile:833: libgstnvdec.la] Error 1

(2) Install NVDEC and NVENC as GStreamer plugins · GitHub

cd sys/nvenc
make                            <- Fails here

CC libgstnvenc_la-gstnvenc.lo
cc1: warning: /path/to/gst-plugins-bad/sys/nvenc: No such file or directory [-Wmissing-include-dirs]
gstnvenc.c: In function ‘gst_nvenc_create_cuda_context’:
gstnvenc.c:288:9: warning: ‘cuDeviceComputeCapability’ is deprecated [-Wdeprecated-declarations]
288 | && cuDeviceComputeCapability (&maj, &min, cdev) == CUDA_SUCCESS) {
| ^~
In file included from gstnvenc.h:27,
from gstnvenc.c:24:
./cuda.h:4163:36: note: declared here
4163 | CUDA_DEPRECATED CUresult CUDAAPI cuDeviceComputeCapability(int *major, int *minor, CUdevice dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
CC libgstnvenc_la-gstnvbaseenc.lo
cc1: warning: /path/to/gst-plugins-bad/sys/nvenc: No such file or directory [-Wmissing-include-dirs]
In file included from /usr/lib/aarch64-linux-gnu/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from /usr/include/gstreamer-1.0/gst/gst.h:27,
from gstnvenc.h:23,
from gstnvbaseenc.h:23,
from gstnvbaseenc.c:24:
gstnvbaseenc.c: In function ‘nv_preset_to_guid’:
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_DEFAULT_GUID’ undeclared (first use in this function); did you mean ‘NV_ENC_PRESET_P7_GUID’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET
,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET
,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:87:7: note: in expansion of macro ‘CASE’
87 | CASE (DEFAULT, DEFAULT);
| ^~~~
gstnvbaseenc.c:86:79: note: each undeclared identifier is reported only once for each function it appears in
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:87:7: note: in expansion of macro ‘CASE’
87 | CASE (DEFAULT, DEFAULT);
| ^~~~
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_HP_GUID’ undeclared (first use in this function); did you mean ‘NV_ENC_PRESET_P7_GUID’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:88:7: note: in expansion of macro ‘CASE’
88 | CASE (HP, HP);
| ^~~~
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_HQ_GUID’ undeclared (first use in this function); did you mean ‘NV_ENC_PRESET_P7_GUID’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:89:7: note: in expansion of macro ‘CASE’
89 | CASE (HQ, HQ);
| ^~~~
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID’ undeclared (first use in this function); did you mean ‘GST_NV_PRESET_LOW_LATENCY_DEFAULT’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:91:7: note: in expansion of macro ‘CASE’
91 | CASE (LOW_LATENCY_DEFAULT, LOW_LATENCY_DEFAULT);
| ^~~~
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_LOW_LATENCY_HQ_GUID’ undeclared (first use in this function); did you mean ‘GST_NV_PRESET_LOW_LATENCY_HQ’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:92:7: note: in expansion of macro ‘CASE’
92 | CASE (LOW_LATENCY_HQ, LOW_LATENCY_HQ);
| ^~~~
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_LOSSLESS_DEFAULT_GUID’ undeclared (first use in this function); did you mean ‘GST_NV_PRESET_LOSSLESS_DEFAULT’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:94:7: note: in expansion of macro ‘CASE’
94 | CASE (LOSSLESS_DEFAULT, LOSSLESS_DEFAULT);
| ^~~~
gstnvbaseenc.c:86:79: error: ‘NV_ENC_PRESET_LOSSLESS_HP_GUID’ undeclared (first use in this function); did you mean ‘GST_NV_PRESET_LOSSLESS_HP’?
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:86:63: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:736:47: note: in expansion of macro ‘G_PASTE_ARGS’
736 | define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
| ^~~~~~~~~~~~
gstnvbaseenc.c:86:71: note: in expansion of macro ‘G_PASTE’
86 | define CASE(gst,nv) case G_PASTE(GST_NV_PRESET
,gst): return G_PASTE(G_PASTE(NV_ENC_PRESET_,nv),GUID)
| ^~~~~~~
gstnvbaseenc.c:95:7: note: in expansion of macro ‘CASE’
95 | CASE (LOSSLESS_HP, LOSSLESS_HP);
| ^~~~
gstnvbaseenc.c: In function ‘rc_mode_to_nv’:
gstnvbaseenc.c:131:72: error: ‘NV_ENC_PARAMS_RC_VBR_MINQP’ undeclared (first use in this function); did you mean ‘NV_ENC_PARAMS_RC_VBR’?
131 | define CASE(gst,nv) case G_PASTE(GST_NV_RC_MODE
,gst): return G_PASTE(NV_ENC_PARAMS_RC
,nv)
| ^~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:735:47: note: in definition of macro ‘G_PASTE_ARGS’
735 | define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
| ^~~~~~~~~~~
gstnvbaseenc.c:131:64: note: in expansion of macro ‘G_PASTE’
131 | define CASE(gst,nv) case G_PASTE(GST_NV_RC_MODE_,gst): return G_PASTE(NV_ENC_PARAMS_RC_,nv)
| ^~~~~~~
gstnvbaseenc.c:135:7: note: in expansion of macro ‘CASE’
135 | CASE (VBR_MINQP, VBR_MINQP);
| ^~~~
gstnvbaseenc.c: In function ‘gst_nv_base_enc_set_context’:
gstnvbaseenc.c:458:17: warning: unused variable ‘nvenc’ [-Wunused-variable]
458 | GstNvBaseEnc *nvenc = GST_NV_BASE_ENC (element);
| ^~~~~
gstnvbaseenc.c: In function ‘gst_nv_base_enc_sink_query’:
gstnvbaseenc.c:475:17: warning: unused variable ‘nvenc’ [-Wunused-variable]
475 | GstNvBaseEnc *nvenc = GST_NV_BASE_ENC (enc);
| ^~~~~
make: *** [Makefile:885: libgstnvenc_la-gstnvbaseenc.lo] Error 1

All other instructions I found refer to these, or use things like

nvidia-smi       (which is not available on Jetson to my knowledge)

and instruct to download driver version related content.

Please note that if my post lacks detail due to in-experience on the platform I will correct it as soon as possible.

Hello @alex.davies1 and welcome to the NVIDIA developer forums!

First of all, if you don’t mind, I will move your post to the AGX Orin category, since many of the issues you see are likely attributed to an incorrect setup of the platform.

First of all I would suggest to get a basic driver/CUDA setup on Linux running on the platform before taking the next step of third-party gstreamer installation.

Secondly it seems you did miss step 2 in the gstreamer instructions which was to copy video codec headers into the gst-plugins-bad sub-dir:

cc1: warning: /path/to/gst-plugins-bad/sys/nvenc: No such file or directory [-Wmissing-include-dirs]

In any case, start from scratch with a ready made package for the Orin that already includes proper installation of CUDA and video codecs.

I hope that will help get you started!

Thanks!

Thank you for addressing the post. I have tried to follow your suggestion and re-started the installation process following the cuda-installation-guide-linux. I have documented everything and will attach it below. I ended up replicating the error in the original post.

########### Basic driver/CUDA setup #################

Ref. NVIDIA CUDA Installation Guide for Linux
Verify CUDA Capable GPU

lspci | grep -i nvidia
Out: 0001:00:00.0 PCI bridge: NVIDIA Corporation Device 229e (rev a1)

Verify Supported Version of linux

uname -m && cat /etc/*release

Out:
aarch64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION=“Ubuntu 20.04.6 LTS”

Verify gcc is installed

gcc --version

Out:
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Verify Kernal Headers and Development Packages

uname -r
Out:
5.10.104-tegra
(if failed ensure to install Kernal headers and dev packages)

Download the NVIDIA Toolkit

linux → aarch64-jetson → Native → Ubuntu → 20.04 → deb(local)

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/arm64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-tegra-repo-ubuntu2004-12-1-local_12.1.1-1_arm64.deb
sudo dpkg -i cuda-tegra-repo-ubuntu2004-12-1-local_12.1.1-1_arm64.deb
sudo cp /var/cuda-tegra-repo-ubuntu2004-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

########### GStreamer Installation ###############

sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

Verify installation

dpkg -l | grep gstreamer
gst-launch-1.0 --version

Version → GStreamer 1.16.3

########### Obtain nvenc and nvdec ###############
Ref. Install NVDEC and NVENC as GStreamer plugins · GitHub

cd /home/orin/Downloads/
git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-bad
cd gst-plugins-bad/
git checkout 1.16.3

Download SDK 12.1.14 from Video Code SDK | NVIDIA Developer

cd /home/orin/Downloads/Video_Codec_SDK_12.1.14/
cp /usr/local/cuda/include/cuda.h /home/orin/Downloads/gst-plugins-bad/sys/nvenc
cp Interface/nvEncodeAPI.h /home/orin/Downloads/gst-plugins-bad/sys/nvenc
cp Interface/cuviddec.h /home/orin/Downloads/gst-plugins-bad/sys/nvdec
cp Interface/nvcuvid.h /home/orin/Downloads/gst-plugins-bad/sys/nvdec

From comment suggestion to cover missing dependency

sudo cp /home/orin/Downloads/Video_Codec_SDK_12.1.14/Lib/linux/stubs/aarch64/libnvcuvid.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/
sudo cp /home/orin/Downloads/Video_Codec_SDK_12.1.14/Lib/linux/stubs/aarch64/libnvidia-encode.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/

cd /home/orin/Downloads/gst-plugins-bad
NVENCODE_CFLAGS=“-I/home/orin/Downloads/gst-plugins-bad/sys/nvenc” ./autogen.sh --with-cuda-prefix=“/usr/local/cuda” --disable-gtk-doc

E: bash: ./autogen.sh: No such file or directory Actions, Removed gst_plugins_bad and repeated the installation. I missed a line somehwere and it worked the second time round, I did not re-run to sudo copy cmds.

cd sys/nvenc
make

E: make: *** [Makefile:892: libgstnvenc_la-gstnvbaseenc.lo] Error 1

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

Hi,
We use jetson_multimedia_api for hardware encoding/decoding on Jetson platforms. Please flash system image and SDK Components through SDKManager. And then check samples in

/usr/src/jetson_multimedia_api

Please also refer to the document:
Jetson Linux API Reference: Main Page | NVIDIA Docs

For gstreamer, please check
Accelerated GStreamer — Jetson Linux Developer Guide documentation

Thank you for the response. I had to re-approach my implementation to avoid the issue of needing the nvenc and nvdec. I did this in the period between response due to time limitations on my project. Feel free to close the discussion thread and I can re-address the issue in future if the need ever arises. Thank you for your suggestions.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.