smaple_drivenetNcameras "ImageStreamer: cannot receive, EGLstream busy"

when I run smaple_drivenetNcameras twice at the same time(selector-mask are 1111 and 000000010001), it will report error after working well for about 10s.

[19-6-2019 14:27:42] CameraGMSL: Frame: 509 CaptureTimestamp: 3888641276 - ICP DROP in camera 1
ImgAddFences: Couldn’t find a place to store the fences
NvMediaEglStreamProducerGetImage: Failed to add read fence
[19-6-2019 14:27:42] ImageStreamer: timeout waitPosted, producer waited for 33 ms.
[19-6-2019 14:27:42] ImageStreamer: cannot post, no available slot
[19-6-2019 14:27:42] CameraGMSL: Frame: 524 CaptureTimestamp: 3888676266 - ICP DROP in camera 0
[19-6-2019 14:27:42] CameraGMSL: Frame: 511 CaptureTimestamp: 3888707927 - ICP DROP in camera 1
[19-6-2019 14:27:42] ImageStreamer: cannot receive, EGLstream busy
[19-6-2019 14:27:42] Driveworks exception thrown: DW_INVALID_ARGUMENT: Cannot cast to C handle, given instance is a nullptr

terminate called after throwing an instance of ‘std::runtime_error’
what(): [2019-06-19 14:27:42] DW Error DW_INVALID_ARGUMENT executing DW function:
dwSensorCamera_getImage(&rawImageCUDA, DW_CAMERA_OUTPUT_CUDA_RAW_UINT16, frameHandle)
at /builds/driveav/dw/sdk/samples/drivenet/drivenet_ncameras/main.cpp:477
Aborted (core dumped)

The main.cpp:477 is “dwSensorCamera_getImage” function.
Also there is no eglstreamer code here.

Dear jinj,

Could you please let me know what your case is for this scenario?

And could you please re-try the sample if this symptom happens after “export CUDA_VISIBLE_DEVICES=1” setting up? Thanks.

Thank you for your reply.

I want to identify objects using sample_drivenetNcameras with 6 cameras on PX2.
When I run the modified sample_drivenetNcameras, or the original sample_drivenetNcameras twice at the same time, get the same error.

Dear jinj,

Could you please check this symptom with iGPU? Thanks.
$export CUDA_VISIBLE_DEVICES=1

That’s great!It works well.

But the FPS is only 4.

Can I run one process on iGPU, and another one on dGPU?

Dear jinj,

When run the sample, please set CUDA_VISIBLE_DEVICES first and try to run it like below.

Terminal 1
$export CUDA_VISIBLE_DEVICES=1
$./sample_drivenetNcameras --input-type=camera --selector-mask=1111

Terminal 2
$export CUDA_VISIBLE_DEVICES=0
$./sample_drivenetNcameras --input-type=camera --selector-mask=000000010001

Thanks a lot!

Thank you very much!

Hi Steve,

I used multi-threads get image and processed it, and use type DW_CAMERA_OUTPUT_CUDA_RGBA_UINT8 to directly get cuda image. I used producer-consumer mode to make thread synchronization, and thread 2 process() is much slower than thread 1 getimage().

//Thread 1:
while(true)
{
    dwCameraFrameHandle_t frame_handle;
    dwSensorCamera_readFrame(frame_handle, ..);
    dwImageHandle_t image_handle;
    dwSensorCamera_getImage(image_handle, DW_CAMERA_OUTPUT_CUDA_RGBA_UINT8, frame_handle);
    dwImage_copyConvert(frames_produced.frame_handle, image_handle, sdk);
}
//Thread 2:
while(true)
{
    dwImageCUDA *rgba_image;
    dwImage_getCUDA(rgba_image, frames_consumed.frame_handle);
    Process(rgba_image);//cost about 100ms
}

When I run, it failed and printed error “Driveworks exception thrown: DW_CUDA_ERROR: Call failed cuEGLStreamConsumerAcquireFrame : unspecified launch fahanksilure”.
If I $export CUDA_VISIBLE_DEVICES=1 it run success but fps is 4.
If I $export CUDA_VISIBLE_DEVICES=0 it also run failed.
How did it happen, how can I solve this question?
Thanks!