Run SDK in a Container#
The AR SDK can run in an isolated container. It is easier to try the sample apps without worrying about dependencies. And the docker image can be shared easily. Two more software packages are required: Docker Engine and NVIDIA Container Toolkit.
Install the Prerequisite Software#
Docker Engine#
Docker Engine is an open source containerization technology for building and containerizing your applications.
Please follow this link (https://docs.docker.com/engine/install) to install Docker Engine on your Linux distribution.
Please test Docker Engine on officially supported Linux distributions, such as Ubuntu 20.04.
NVIDIA Container Toolkit#
The NVIDIA Container Toolkit enables users to build and run GPU-accelerated containers. The toolkit includes a container runtime library and utilities to automatically configure containers to leverage NVIDIA GPUs.
Please follow this link (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) to install and configure NVIDIA Container Toolkit.
Fetch Sample Apps Repository#
Fetch the open source repository from NVIDIA-Maxine/AR-SDK-Samples to a local directory ar-sdk-samples, which will be mounted
when launching the container.
Build Docker Image#
Download and install the SDK and all models as described in Install the AR SDK.
Then proceed to ar-sdk-samples/docker and execute the build_docker_image.sh script.
The building script pulls the base image (Ubuntu 20.04) from Docker Hub and
installs required third-party libraries for running sample applications.
Once finished, you will see a Docker image maxine_arsdk created
on your system using the sudo docker image ls command.
The repository name and the TAG can be customized by modifying the
ar-sdk-samples/docker/docker_config.sh and rebuilding the Docker
image.
Launch Container#
Launch the container by executing the script
ar-sdk-samples/docker/docker_config.sh. You can choose a
directory on the host machine mapped to /host in the container
by specifying -m <host_dir> for file sharing purposes.
To run sample apps, the arsdk-samples directory must exist under <host_dir>.
Once the container is launched, you are ready to try the ARSDK sample
applications in /host/arsdk-samples. Only offline mode is supported inside
the container. You can dump the output to the /host directory so
that you can evaluate it in the host system for playback.
For Linux-specific sample app instructions, refer to README.md in the sample app repo.