NVDEC cannot work together with OpenCL in Win32 mode

I am trying to use NVDEC(NvDecoder) to decode stream and then use OpenCL to do some video quality calculation. But found there is conflict between NVDEC and OpenCL.
The issue is : In Win32 mode, the decoder is always blocked at cuvidCreateDecoder cannot return if the clCreateContext is called to create openCL context. But it can work well in x64 mode.

Could you give some suggestions how to use them together in Win32 mode? Thanks.

My test condition:
Hardware: NVIDIA GeForce RTX 3080
NVIDIA GPU Computing Toolkit: v11.3
Video_Codec_SDK: tried 11.1.5 and 9.1.23 both.
The simple test code based AppDecD3D (9.1.23) could be found at NvCodecTestSample/FramePresenterD3D11.h at main · maxydg/NvCodecTestSample · GitHub

Hi Maxyan, are you calling clCreateContext before or after cuvidCreateDecoder?

Can you post the sample code that does not work?

Thanks @Abhijit_Patait,

Are you calling clCreateContext before or after cuvidCreateDecoder?
Currently we are calling clCreateContext before cuvidCreateDecoder, then the decoder will be blocked.
#And we also tried to call clCreateContext after decoding first frame, the decoder will crash after clCreateContext.

Can we get the sample code that works and doesn’t work?
I have created a test sample based on AppDecD3D in Video_Codec_SDK_9.1.23.
NvCodecTestSample/NvDecAndOpenCLTest/NvDecAndOpenCLTest at main · maxydg/NvCodecTestSample · GitHub

Please let me know if additional information is required, thanks.

Hi Maxyan,
Can you try changing the order of initCuda and initOpenCL at below place and let us know if it fixes the hang you are seeing?

Thanks @nikhilj , after changing the order of initCuda and initOpenCL, the decoder blocking issue is gone. But I found another issue: the execution of running openCL code is blocked.

Let me clear up the code and share it later. And you can also try some OpenCL code at the same if possible. Thanks.