Closed DannisMa closed 9 months ago
DLL check is already here.
Can you tell me when you have a crash?
Maybe you should also check for the presence of 'nvEncodeAPI64.dll' because, in my situation, the project abruptly close after importing the WebRTC package without generating any crash logs in "C:\User\AppData\Local\Temp\Unity\Editor\Crashes".
Unity version: 2022.3.9f1 Package version: com.unity.webrtc@3.0.0-pre.6
@DannisMa If you put the code which you suggested to CudaContext.cpp, is the crash stopped?
@DannisMa If you put the code which you suggested to CudaContext.cpp, is the crash stopped?
Yes, the crash is stopped and the project works well.
@DannisMa I would like to aggregate the checking process in one part in code. Can you move the checking process to CudaContext.cpp ?
static bool FindModule()
{
if (s_hModule)
return true;
#if UNITY_WIN
// dll delay load
HMODULE module = LoadLibrary(TEXT("nvcuda.dll"));
if (!module)
{
RTC_LOG(LS_INFO) << "nvcuda.dll is not found.";
return false;
}
s_hModule = module;
>>>
>>> // add checking process here
>>>
#elif UNITY_LINUX
...
@karasusan Okay, I've already moved the checking process to CudaContext.cpp.
Some CUDA platforms do not support NvEncoder, so using the relevant API without confirmation will cause a crash. https://github.com/Unity-Technologies/com.unity.webrtc/issues/806 I referred to Nvidia's GitHub project, we can see that it checks for DLLs before calling NvEncoder APIs. https://github.com/NVIDIA/video-sdk-samples/blob/aa3544dcea2fe63122e4feb83bf805ea40e58dbe/Samples/NvCodec/NvEncoder/NvEncoder.cpp#L58