AppEncCuda.cpp too few arguments to cuCtxCreate

I’m trying to build the video codec sdk samples on Linux Mint. I struggled with the CMakeList.txt as the way of searching for the cuda library seems to be deprecated and was picking up on the wrong installation of cuda.

I’ve manually specified the headers and libraries for cuda (I have version 13.0) and made some progress building but now I’m stuck with:

Video_Codec_SDK_13.0.19/Samples/AppEncode/AppEncCuda/AppEncCuda.cpp:666:31: error: too few arguments to function ‘CUresult cuCtxCreate_v4(CUctx_st**, CUctxCreateParams*, unsigned int, CUdevice)’

It seems the source was targeting an old version of cuda and no longer works. I’m wondering how to proceed.

I’ve recently switched from Windows and not very familiar with CMake. In a separate programme I’ve built my source but the call to m_nvenc.nvEncInitializeEncoder is giving an invalid parameter. I saw advice only to see if the samples compiled but that’s where I’m now stuck.

I decided to have a conversation with ChapGPT and am making progress. First thing was to make sure CMake was using the latest version of cuda that I have on my system (for some reason I have a few). Then it suggested updates to the CMakeList.txt files as the cuda functions have been deprecated. Looks like the sample files could do with an update

Also, the samples won’t build with latest cuda. Need to replace lines reading:

ck(cuCtxCreate(&cuContext, 0, cuDevice));

with

ck(cuCtxCreate(&cuContext, nullptr, 0, cuDevice));

Thanks @joe181 for the details and welcome to the NVIDIA developer forums!

The samples are getting regular updates, but they might lag behind when CUDA itself receives major updates.

Thanks for digging into this and your patience!

Ok no problem. Maybe also feed back that CMakeLists.txt is very out of date