Accessing nvarguscamera within docker as non root user [resolve file permissions]

Note: My jetpack version = 4.4 | platform AGX Xavier

Hi,
I’m trying to do the things below in a docker container (all works fine without/outside docker)

  • Build the jetson multimedia api within docker [working]
  • Install [working]
  • run argus_camera [not working as non root user]

observations

non root user can’t run argus_camera

nvidia@jetson:~$ argus_camera
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession

root user can! (and it works fine)

root@jetson:/home/nvidia# argus_camera
Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
^Croot@jetson:/home/nvidia# 

also if i do a gst-inspect -b as root I get better results

root@jetson:/home/nvidia# gst-inspect-1.0 -b
Blacklisted files:
  libnvdsgst_infer.so
  libnvdsgst_inferserver.so
  libnvdsgst_osd.so

if I do the same as non root:

nvidia@jetson:~$ gst-inspect-1.0 -b
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
2021-12-21 12:43:40.746802: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.2
nvbufsurftransform:cuInit failed : 100 
2021-12-21 12:43:41.158661: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.2
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
nvbufsurftransform:cuInit failed : 100 
Blacklisted files:
  libnvdsgst_infer.so
  libgstnvvideoconvert.so
  libnvdsgst_multistream.so
  libnvdsgst_tracker.so
  libnvdsgst_dsexample.so
  libnvdsgst_dewarper.so
  libnvdsgst_inferserver.so
  libnvdsgst_multistreamtiler.so
  libnvdsgst_osd.so
  libgstnvjpeg.so
  libgstnvarguscamerasrc.so
  libgstnvvideosinks.so
  libgstnvdrmvideosink.so
  libgstnvv4l2camerasrc.so
  libgstnvvideo4linux2.so
  libgstomx.so
  libgstnvcompositor.so
  libgstnvvidconv.so
  libgstnvivafilter.so

Total count: 19 blacklisted files
nvidia@jetson:~$ 

I think the workaround is to give the same (uid:gid) rwx privilages to a phantom user in the host (jetson) as (same uid:gid) my non root user (in docker) but I don’t exactly know what files (this is just my suspicion) please help.

Cheers,
Ganindu.

@D3_growe (I’ve tagged you just in case)

P.S cache clearing or ldd/ldconfig tricks don’t work (because it’s likely a filesystem/permissions error) also please note that my jetson username:uid:gid(nvidia:1000:1000) is replicated inside the docker container.

Hi,
i have the same problem. Could you solve the issue?

Hi Yes I did!! Are you still using jetpack 4.4? (Also is your problem urgent, I will probably not be around till Friday! (apologies))

Thanks for you quick response. I was able to solve it on my own. I had to add the user to the video group using the --group-add option. Now camera access as user inside the container seems to work.

1 Like

Nice!! probably that’s what I did too!

One thing I was wondering is whether the eglsink can be forwarded over X (which argus_camera also uses, can somehow be forward the same way the X session is forwarding rendering contexts for other apps, I think it is a gpu context things but my PC graphics card also uses cuda as it was made by nvidia)

Adding RTSP blocks is a bit of work sometimes.