[ERROR] [nvjpeg_cuda_encoder] Could not encode jpeg code stream - nvjpeg error #8
Describe the question.
When using the JPEG encoder, the following error message appears when processing smaller-sized images:
[ERROR] [nvjpeg_cuda_encoder] Could not encode jpeg code stream - nvjpeg error #8 (internal error) when running nvjpegEncodeYUV(handle_, state, encode_params.get(), &input_image, input_chroma_subsampling, image_info.plane_info[0].width, image_info.plane_info[0].height, image_info.cuda_stream) at /home/jenkins/agent/workspace/nvimagecodec/helpers/release_v0.4.0/Release_12/build/extensions/nvjpeg/cuda_encoder.cpp:420.
However, the saved image looks like correct. I would like to confirm whether, in this case, the encoding falls back from GPU nvjpeg to CPU. Additionally, is there a way to suppress this error message or change it to a warning?
Check for duplicates
- [x] I have searched the open bugs/issues and have found no duplicates for this bug report
Hi @lantudou,
You are right, in that case, encoding falls back to the CPU. You can increase the logging level to 3 via the PYNVIMGCODEC_VERBOSITY environment variable to enable INFO logging, which will indicate which encoder was used.
Unfortunately, there is no way to turn off specific error messages.
Could you please share with us the image and code snippet that caused the problem? We will try to update the nvJPEG encoder's checks so that we don't fail to encode and avoid producing this error message.
I encountered the same error log, however the process crashed for me, it does not fall back to cpu (or it falls back to cpu and then crashes...)
i was trying to encode numpy array of uint8 values (grayscale) of dimensions x=49152, y=32768
edit, sorry, actually my error was error #5 (allocator failure), didn't read enough :')
The crash for me occurred when encoding to jpeg, using jpeg2k works.