Container Deployment#
We offer Docker containers via the NGC registry for deployment purposes. This guide will demonstrate how to deploy an operational Audio2Face-3D Authoring Microservice by configuring and running the Docker image.
You need to login to the nvcr.io docker registry, follow the instruction of Generate API Key on NGC.
Dependencies#
- To do so you will need the following dependencies:
Using Docker Compose#
To run Audio2Face-3D Authoring microservice the easiest way is to use docker compose.
To get started with a quick deploy save the following file as docker-compose.yaml
:
docker-compose.yaml
services:
a2f-authoring:
image: nvcr.io/nvidia/ace/a2f-authoring:0.3.6
volumes:
- models_a2f:/tmp/a2f
- models_a2e:/tmp/a2e
command: bash -c 'python3 generate_trt_models.py ${A2F_3D_MODEL_NAME}_v2.3 trt_params_prod.json && a2f-authoring /app/configs/${A2F_3D_MODEL_NAME}_v2.3-config.json'
network_mode: "host"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
volumes:
models_a2f: {}
models_a2e: {}
You can then set the A2F_3D_MODEL_NAME
environment variable to either james
, mark
or claire
depending
on your preference for deployment and run docker compose up
.
$ export A2F_3D_MODEL_NAME=james
$ docker compose up
Wait for the service to display readiness and you can start interacting with it.
...
a2f-authoring-1 | 2024-09-18T15:33:57.763448Z INFO a2f_authoring: Service is initialized!
You are now running a local deployment of the Audio2Face-3D Authoring Microservice.
Single container deployment#
If you do not want to deploy the container using docker-compose
you can run the container with plain docker commands.
$ docker run -it --rm --network=host --gpus all nvcr.io/nvidia/ace/a2f-authoring:0.3.6 ./run_james_model.sh
If you wish to run mark
model instead:
$ docker run -it --rm --network=host --gpus all nvcr.io/nvidia/ace/a2f-authoring:0.3.6 ./run_mark_model.sh
If you wish to run claire
model instead:
$ docker run -it --rm --network=host --gpus all nvcr.io/nvidia/ace/a2f-authoring:0.3.6 ./run_claire_model.sh
Note
To find the checksum of nvcr.io/nvidia/ace/a2f-authoring:0.3.6
, run:
$ docker images --digests nvcr.io/nvidia/ace/a2f-authoring:0.3.6
You should get:
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
nvcr.io/nvidia/ace/a2f-authoring 0.3.6 sha256:82bef15da36c2b2d7eb19e233ddb417d5ea598147a03541656866abd92501163 a6b6c93e4116 2 weeks ago 35.6GB
If this approach fails, try running the Docker command without specifying the tag, but ensure that the version is correct.
$ docker images --digests nvcr.io/nvidia/ace/a2f-authoring
TRT Engine Generation#
During the deployment process, a TRT engine will need to be generated to optimize the models for the given GPU. This TRT engine will need to be regenerated when deployment environment changed. This is especially the case when GPU changes are present, with a different architecture or compute capability. The generated TRT engine can potentially be reused on machines with the exact same controlled configuration (same hardware + docker). It is recommended to always regenerate the TRT engine whenever hardware changes are made.