Deepstream nvv4l2h264enc error

I tried hardware accelerated h264 encoding with gst-launch command.

But, I met following error message.

ERROR: from element /GstPipeline:pipeline0/nvv4l2h264enc:nvv4l2h264enc0: Device ‘/dev/nvhost-msenc’ failed during initialization

I couldn’t find /dev/nvhost-msenc file. So I think there was some problem with installing.
I installed the correct version of deepstream softwares.
How can I solve this problem?

cudnn 7.6.5
cuda toolkit 10.2
• Hardware Platform (Jetson / GPU) GTX1080
• DeepStream Version 5.0.1
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.0
• NVIDIA GPU Driver Version (valid for GPU only) 450.51
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Can you show us your pipeline?
The following pipeline can work:
gst-launch-1.0 --gst-debug=v4l2videoenc:5 videotestsrc pattern=15 ! ‘video/x-raw, format=RGBA, width=1280, height=720, fps=30/1’ ! nvvideoconvert ! ‘video/x-raw(memory:NVMM), format=NV12, width=1280, height=720’ ! nvv4l2h264enc bitrate=2000000 profile=2 ! filesink location=test.264

gst-launch-1.0 filesrc location=/opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_720p.mp4 ! decodebin ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! flvmux ! rtmpsink location=rtmp://localhost/live

This is my pipeline. I don’t know what is wrong…

Your pipeline also outputs this error message. There is the same error message in the middle.
/dev/nhost-msenc

Setting pipeline to PAUSED …
0:00:00.021634470 21026 0x55d770df1090 DEBUG v4l2videoenc gstv4l2videoenc.c:396:gst_v4l2_video_enc_open: Opening
0:00:00.022221039 21026 0x55d770df1090 DEBUG v4l2videoenc gstv4l2videoenc.c:506:gst_v4l2_video_enc_start: Starting
Pipeline is PREROLLING …
0:00:00.022625261 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:640:gst_v4l2_video_enc_set_format: Setting format: video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, fps=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12
0:00:00.022638435 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:870:gst_v4l2_video_enc_negotiate: Negotiating H264 profile and level.
0:00:00.022646291 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:918:gst_v4l2_video_enc_negotiate: Selected H264 profile (null) at level (null)
Redistribute latency…
0:00:00.022796551 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:640:gst_v4l2_video_enc_set_format: Setting format: video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, fps=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12
ERROR: from element /GstPipeline:pipeline0/nvv4l2h264enc:nvv4l2h264enc0: Device ‘/dev/nvhost-msenc’ failed during initialization
0:00:00.022805873 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:870:gst_v4l2_video_enc_negotiate: Negotiating H264 profile and level.
Additional debug info:
gstv4l2object.c(4070): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/nvv4l2h264enc:nvv4l2h264enc0:
Call to S_FMT failed for NM12 @ 1280x720: Unknown error -1
0:00:00.022819677 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:918:gst_v4l2_video_enc_negotiate: Selected H264 profile (null) at level (null)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
0:00:00.022831992 21026 0x55d770de3ed0 DEBUG v4l2videoenc gstv4l2videoenc.c:1248:gst_v4l2_video_enc_decide_allocation:nvv4l2h264enc0:src deactivating pool
0:00:00.022892570 21026 0x55d770df1090 DEBUG v4l2videoenc gstv4l2videoenc.c:520:gst_v4l2_video_enc_stop: Stopping
0:00:00.022915198 21026 0x55d770df1090 DEBUG v4l2videoenc gstv4l2videoenc.c:544:gst_v4l2_video_enc_stop: Stopped
0:00:00.022922337 21026 0x55d770df1090 DEBUG v4l2videoenc gstv4l2videoenc.c:484:gst_v4l2_video_enc_close: Closing
Freeing pipeline …

The pipeline is correct. You need to check your drivers.

I also suspect so. It could be driver or hardware. How can I check it?
The error message clearly says about /dev/nvhost-msenc. But I couldn’t find it in the /dev directory of my system.
Any idea?

I don’t think you can do anything with the driver. Maybe reinstall the driver?

I tried reinstalling the whole system many times. Still the same error.
Is it related to GPU driver version?
Should try another driver version? I am using 450.51.
How can I check if it is a hardware problem or not?

The version is OK. Can you run v4l2decoder pipeline in this device? Do you have other GTX1080 hardware, will it also fail with encoder functions?

Is there no other way to check the hardware but to use other computer system?
Is it related to my using ubuntu server version?(not desktop)

Just propose that it is not a hardware problem. Then where should I look at?

For ubuntu version, we have mentioned the ubuntu version for deepstream in Quickstart Guide — DeepStream 6.1.1 Release documentation

There are other users using deepstream with GTX1080, so we can not propose more if there is no useful information to us.

I already checked that page.
How slow is deepstream using a docker image? If it is compared to a newly installed ubuntu server ?

If the host shares all resources with the docker, they are the same performance.

Thank you very much…

I tried to use docker image in ubuntu server 18.04. (DIPLAY variable is null.)

sudo docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY nvcr.io/nvidia/deepstream:5.0.1-20.09-triton

docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].

This error occured. Is it not possible to use the docker image with ubuntu server?

I solved the problem with the help of this page(below)

1 Like

I found that the opencv library in the docker image is compiled without cuda support.
Is this true?

No, it is not cuda based opencv.

I didn’t find anything related to [nvv4l2h264enc error], could you give me some gints?