Using two DLA gets errors

Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
DRIVE OS Linux 5.2.0
[yes] DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
[yes] Linux
QNX
other

Hardware Platform
[yes] NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
[yes] 1.6.0.8170
other

Host Machine Version
[yes] native Ubuntu 18.04
other

I create two threads to run dla0 and dla1, but creating engine by deserializeCudaEngine will failed.

Dear @wang_chen2,
Is the same engine used for both DLA cores? Could you provide more details on error and also code snippet?

Dear SivaRamaKrishnaNV,
I have two engines which are generated for two DLAs. I can use the same engine to create a set of GPU engines.

error log: …/rtExt/dla/eglUtiles.cpp(124) - EGL Error in findEglDevice: -1

code:
void* onProcess(void* args)
{

runtime->setDLACore(dlaCore);
engine = runtime->deserializeCudaEngine(…);

}

main()
{

pthread_create(thread0, NULL, onProcess, &dla[0]);
pthread_create(thread0, NULL, onProcess, &dla[1]);
}

Hi,
I try to sleep 5s between thread_create and it works.
If you know the reason, I will very happy.
Thanks.

Dear @wang_chen2,
As per my understanding, using DLA needed a EGLdevice internally, when both threads tries to get access to EGLdevice at same time, one thread is failing. When we introduce some delay, the issue is getting resolved. Could you reduce the sleep time and experiment when this issue is not observed for our understanding

Hi,
I had some tests. Finally, I need to sleep 2s between two threads.