NVMAP_IOC_WRITE failed: Interrupted system call

Hello,

I want to convert bayerGB → rgba → NvVideoEncoder. My code is:
The code based on cudaBayerDemosaic and frontend

Thank you!

init()
{

initCUDA(&cudaContext_);
cuMemAlloc(&rgba_buffers_, bufferSize);
}

process()
{

unsigned char *bayer_buffer = static_cast<unsigned char *>(imagePtr->GetData());

cudaBayerDemosaic((CUdeviceptr) bayer_buffer,
CAMERA_IMAGE_WIDTH,
CAMERA_IMAGE_HEIGHT,
CAMERA_IMAGE_WIDTH * 4,
CU_EGL_COLOR_FORMAT_ARGB,
(CUdeviceptr)rgba_buffers_);

Raw2NvBuffer((unsigned char *)rgba_buffers_, 0, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT, m_argb_dmabuf_fd);

}

Hi,
https://devtalk.nvidia.com/default/topic/1068234/jetson-agx-xavier/how-can-i-convert-rgb8-to-h264-/post/5410820/#5410820

Please call NvBufferTransform() to convert NvBufferColorFormat_ABGR32 to NvBufferColorFormat_YUV420.
NvBufferColorFormat_ABGR32 should be pitch linear and NvBufferColorFormat_YUV420 is block linear.

hi,

My problem is bayerGB → rgba(because spinnakersdk convert it too slow). So I use cudaBayerDemosaic to convert.

rgba → NvVideoEncoder is ok now. Thanks for your help in the past.

I use nppiCFAToRGBA_8u_C1AC4R fix the problem

unsigned char *bayer_buffer = static_cast<unsigned char *>(imagePtr->GetData());

cudaMemcpy2D(vesc_bayer_dev_, resv_bayer_step_, bayer_buffer, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_WIDTH,
             CAMERA_IMAGE_HEIGHT, cudaMemcpyHostToDevice);

NppiSize size = { CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT };
NppiRect roi  = { 0, 0, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT };
NppStatus npp_convert_status = nppiCFAToRGBA_8u_C1AC4R(vesc_bayer_dev_, resv_bayer_step_, size, roi, resv_rgba_dev_,
                                                       resv_rgba_step_, NPPI_BAYER_RGGB, NPPI_INTER_UNDEFINED, 0xff);

Good to hear that and thanks for sharing your finding.