symbol lookup error with cuvidGetDecodeStatus

I have compiled the samples/AppDecode/AppDec in video codec sdk.

Everything is fine when compiling.

but when running the program,

./AppDec -i ~/facenet-tensorRT/video_first_1_960.h264
GPU in use: GeForce GTX 1080
Decode with demuxing.
[INFO ][17:34:17] Media format: raw H.264 video (h264)
Session Initialization Time: 26 ms
./AppDec: symbol lookup error: ./AppDec: undefined symbol: cuvidGetDecodeStatus

there is a symbol lookup error.

And I tried ldd to find the shared libraries linked to.

linux-vdso.so.1 =>  (0x00007ffd691fb000)
libcuda.so.1 => /usr/lib/x86_64-linux-gnu/libcuda.so.1 (0x00007fa81717d000)
libnvcuvid.so.1 => /usr/lib/nvidia-384/libnvcuvid.so.1 (0x00007fa816d2e000)
libavcodec.so.58 => /home/tumh/ffmpeg_build/lib/libavcodec.so.58 (0x00007fa81567e000)
libavutil.so.56 => /home/tumh/ffmpeg_build/lib/libavutil.so.56 (0x00007fa815406000)
libavformat.so.58 => /home/tumh/ffmpeg_build/lib/libavformat.so.58 (0x00007fa814fb7000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa814c35000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa814a1f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa814654000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa81434b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa814147000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa813f29000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa813d21000)
libnvidia-fatbinaryloader.so.384.103 => /usr/lib/nvidia-384/libnvidia-fatbinaryloader.so.384.103 (0x00007fa813acf000)
libGL.so.1 => /usr/lib/nvidia-384/libGL.so.1 (0x00007fa81382a000)
libswresample.so.3 => /home/tumh/ffmpeg_build/lib/libswresample.so.3 (0x00007fa81360d000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa8133eb000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa8131d0000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007fa812fc0000)
/lib64/ld-linux-x86-64.so.2 (0x000055c109d52000)
libGLX.so.0 => /usr/lib/nvidia-384/libGLX.so.0 (0x00007fa812d8f000)
libGLdispatch.so.0 => /usr/lib/nvidia-384/libGLdispatch.so.0 (0x00007fa812ac1000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa812787000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fa812574000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa812352000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa81214e000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa811f47000)

you can see that the executable links to /usr/lib/nvidia-384/libnvcuvid.so.1, but there is one located in NvCodec/Lib/linux/stubs/x86_64/libnvcuvid.so.

What is the difference between these two libnvcuvid.so?

it seems that the possible solution is to link NvCodec/Lib/linux/stubs/x86_64/libnvcuvid.so, not the driver’s one.

However, I tried to add the path to LD_LIBRARY_PATH, but it does not work. it still link to the driver lib.

Any advice?

Environment: cuda-8.0

Hi,

Seems like you’re using linux as the OS. What’s your driver version and the exact OS version you are using?

Thanks,
Ryan Park

Hi,

My mistake, I see that your driver version is R384.

Please upgrade to R396 drivers. The said API is not supported on R384 drivers.

Stub libraries (libnvcuvid.so and libnvidia-encode.so) have been included as part of the SDK package, in order to aid development of applications on systems where the NVIDIA driver has not been installed. The sample applications in the SDK will link against these stub libraries as part of the build process. However, users need to ensure that the stub libraries are not referenced when running the sample applications. A driver compatible with this SDK needs to be installed in order for the sample applications to work correctly.

Thanks,
Ryan Park