Can't access nvhost-msenc inside a container

Running the following docker run command:
sudo docker run -it --net=host --device=/dev/nvhost-msenc --runtime=nvidia 428205b27ec4

With the following gstreamer command:
gst-launch-1.0 videotestsrc is-live=1 num-buffers=600 ! video/x-raw,width=320,height=240,framerate=60/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)NV12’ ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=filename_h265.mp4 -e

I get the following error regarding nvv4l2e265enc:
ERROR: from element /GstPipeline:pipeline0/nvv4l2h265enc:nvv4l2h265enc0: Could not open device ‘/dev/nvhost-msenc’ for reading and writing.
Additional debug info:
/dvs/git/dirty/git-master_linux/3rdparty/gst/gst-v4l2/gst-v4l2/v4l2_calls.c(651): gst_v4l2_open (): /GstPipeline:pipeline0/nvv4l2h265enc:nvv4l2h265enc0:
system error: No such file or directory

Anyone have an idea of what is wrong here?

Hi,

Could you share where the command comes from?
Thanks.

Do you mean the gstreamer pipeline? I took a random pipeline command from NVIDIA forums.
This error persist on every pipeline I’m trying.

Hi,

No, we want to know the docker command comes from.

The GStreamer command works well.
We tested it within a base container, the h265 mp4 file can generate without error.
Please give it a try.

$ export DISPLAY=:0
$ xhost +
$ sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:35.3.1
# gst-launch-1.0 videotestsrc is-live=1 num-buffers=600 ! video/x-raw,width=320,height=240,framerate=60/1 ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)NV12' ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=filename_h265.mp4 -e
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE 
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 8 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 
NVMEDIA: H265 : Profile : 1 
NVMEDIA: Need to set EMC bandwidth : 5744000 exit

Thanks.

Hi, thanks for your reply.

When I run xhost + I get this error:
user@user-desktop:~$ export DISPLAY=:0
user@user-desktop:~$ xhost +
Invalid MIT-MAGIC-COOKIE-1 keyxhost: unable to open display “:0”

When I run the docker and then the GStreamer command, the pipline runs however I get the following errors(Bolded):

No protocol specified
**No EGL Display **
nvbufsurftransform: Could not get EGL display connection
No protocol specified
nvbuf_utils: Could not get EGL display connection
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 204)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
No protocol specified
**No EGL Display **
nvbufsurftransform: Could not get EGL display connection
Setting pipeline to PAUSED …
No protocol specified
nvbuf_utils: Could not get EGL display connection
No protocol specified
nvbuf_utils: Could not get EGL display connection
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Redistribute latency…
NvMMLiteOpen : Block : BlockType = 8
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
NVMEDIA: H265 : Profile : 1

Hi,

Do you have a display device connected to the Jetson?
If not, could you try unset DISPLAY to see if it helps?

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.