Ask Your Question

Revision history [back]

I've resolved this problem.

The fact is file /usr/local/cuda-9.0/targets/x86_64-linux/include/dynlink_cuviddec.h contains code which requires additional symbol loading (which you can faound either in /usr/local/cuda-9.0/samples/3_Imaging/cudaDecodeGL/dynlink_nvcuvid.cpp or in the Video Codec SDK samples here: Video_Codec_SDK_8.0.14/Samples/common/src/

So, if you want to compile OpenCV sample decoder, you must compile dynlink_nvcuvid.cpp with your project while including files dynlink_cuviddec.h and dynlink_nvcuvid.h from Video Codec SDK

Also, don't forget to init API functions:

    void* hHandleDriver = 0;
    CUresult res = cuInit(0, __CUDA_API_VERSION, hHandleDriver);
    if (res != CUDA_SUCCESS) {
        throw exception();
    }
    res = cuvidInit(0);
    if (res != CUDA_SUCCESS) {
        throw exception();
    }