ZED via Singularity/Non-privileged Docker container

Singularity is similar to docker used mostly for cluster tasks. I am having issues using Python api with it. I used:
singularity run --nv docker://stereolabs/zed:3.5-runtime-cuda11.0-ubuntu18.04

Dependencies are fine (nvidia-smi)
The problem is permissions are screwed up:

>>> import pyzed
>>> import pyzed.sl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyzed.sl'

It happens because

Singularity> ls /usr/local/zed/
ls: cannot open directory '/usr/local/zed/': Permission denied
Singularity> ls /usr/local/lib/python3.6/dist-packages/pyzed
ls: cannot open directory '/usr/local/lib/python3.6/dist-packages/pyzed': Permission denied

I assume this is because singularity inherits system privilege and you don’t typically use it with root. Does anyone know if there are any easy workarounds? It currently seems likely impossible to use zed api if you don’t have any root.

1 Like

Hello,

I’ve never used singularity before. On my setup I just run

docker run -it --rm --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all stereolabs/zed:3.7-runtime-cuda11.5-ubuntu20.04

And I encounter no issues.
Maybe that’s because docker is usually root. Maybe if you have permission issues you can try to build your own docker image from ours, and just add the permission to the folder ?

Your Dockerfile would look like

FROM stereolabs/zed:3.5-runtime-cuda11.0-ubuntu18.04RUN chmod -R 777 /usr/local/zed

Antoine Lassagne
Senior Developer - ZED SDK
Stereolabs Support