Refresh docker mount for /tmp/argus_socket

I use the below command to mount my the argus_socket into my docker container.

docker run -dit --gpus all --privileged  -v /tmp/.X11-unix/:/tmp/.X11-unix/ -e DISPLAY=$DISPLAY -v /tmp/argus_socket:/tmp/argus_socket --network=host --name=myimage myimage bash 

But I realized that, if on the host system, I run

sudo service nvargus-daemon restart

Then in the container, the /tmp/argus_socket file won’t be refreshed (I observed the file creation time). Also if I try to use argus SDK, it will direct raise the below error

(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)

I have to restart the docker container to refresh the argus_socket file. Is there any better ways to do that? i don’t know why this mounted device fd can’t be auto refreshed.

I’m using Xavier AGX with jp 4.6.1

Also a follow-up question, the reason that I want to do sudo service nvargus-daemon restart is mainly that if I exit my application which is calling argus in properly (for example using ctrl+c or it’s just crashed due to some issue), it will leave the argus-daemon malfunction and if I rerun my application, it will be stuck at reading camera info. Then I have to restart the daemon to make it work.

I would like to narrow down if the APP run in normal environment have the same symptom.

when running in normal env without docker, it’s not a problem. In normal env, if app crashed or something, i can directly rerun. However, sometimes crash can cause the nvargus daemon hanging and I have to run sudo service nvargus-daemon restart. But after running this restart cmd, the /tmp/argus_socket will be updated and I can directly run the my app.

In the normal environment the nvargus-daemon will restart if some problem cause the crash.

Becouse you mounted socket file directly.

Restarting nvargus-daemon will delete the existing socket file and create a new socket file.
The i-node of the socket file will also be new.
The docker mount is managed by i-node.
New i-node is not mounted and therefore not available.

How about mounting the /tmp directory instead?


docker run -dit --gpus all --privileged  -v /tmp/.X11-unix/:/tmp/.X11-unix/ -e DISPLAY=$DISPLAY -v /tmp/argus_socket:/tmp/argus_socket --network=host --name=myimage myimage bash 


docker run -dit --gpus all --privileged -e DISPLAY=$DISPLAY  -v /tmp/:/tmp/ --network=host --name=myimage myimage bash 



Thanks, this is good idea, let me try it out

The crash i mentioned, i mean our app crash. Basically our app crash and then it didn’t clean up argus resources. Then if I just restart my app, the argus daemon will hang. I have to restart the argus daemon manually.

OK, that could be the APP didn’t handle well to close to release and still acquire the resource from daemon.

This works perfectly! Thanks a lot!

1 Like

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