[FFmpeg-devel] [PATCH] libavutil/hwcontext_cuda: fix bug in cuda_device_uninit

Roman Arzumanyan r.arzumanyan at visionlabs.ai
Fri Sep 29 15:48:12 EEST 2023


Hello,

In my previous patch which introduced the AV_CUDA_USE_CURRENT_CONTEXT
feature I unintentionally made a mistake of not checking this flag when
uninitializing the CUDA.
It was causing cuda_device_uninit() function to destroy the CUDA context it
didn't create.

So far it only reproduces under cuda compute sanitizer:

========= COMPUTE-SANITIZER

========= Program hit invalid device context (error 201) on CUDA API call
to cuCtxDestroy_v2.


But nonetheless shall be fixed. Please find a fix in attached file, now
cuCtxDestroy is called under condition.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavutil-hwcontext_cuda-fix-cuda_device_uninit-when.patch
Type: application/octet-stream
Size: 1051 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230929/ee9358b6/attachment.obj>


More information about the ffmpeg-devel mailing list