Video Codec SDK samples linkage

Hi all,

hope someone can answer this to me :). The Video Codec SDK NvDecodeD3D9 sample (as well as other samples) use LoadLibrary and GetProcAddress to call the various cu* and cuvid* functions. This is something that I do not like. I would like to use some static libraries to link against in my application. But when I look at the cudaDecodeD3D9 sample coming with the latest CUDA Toolkit, it turns out that the headers (e.g. cuviddec.h) are outdated compared to the headers coming with the Video Codec SDK (e.g. dynlink_cuviddec.h), some structure members are missing etc.

So my questions is: Is it possible and safe to use the dynlink_* headers in my application but link statically against cuda.lib and nvcuvid.lib coming with CUDA Toolkit instead of retrieving all function pointers manually using GetProcAddress? My guess is “yes”, provided the static libraries contain all the functions that are used by the Video Codec SDK samples.

Thank you very much.


We understand your concern. Historically, CUDA toolkit has been including older versions of video codec libraries. We are updating those in the next release of the CUDA toolkit. Given the current situation, and to avoid complications arising from version mismatches of various libraries, however, the only reliable solution is to use LoadLibrary and GetProcAddress. Good news is that we will be fixing all of this in the next release of the Video Codec SDK.