Use the AFX SDK in Containers#
The AFX SDK can be used with any containerization technology that supports the NVIDIA Container Toolkit (such as Docker) without requiring any changes.
Note
Using the AFX SDK in containers might introduce negligible differences in performance compared to bare-metal deployments due to virtualization overheads, depending on the containerization technology used and how it is configured. For further details, refer to the containerization technology’s performance optimization guide.
For reference on how to package the SDK for containerization, a sample container configuration based on Docker is provided under samples/container.
To use the sample Docker container:
Ensure that you have Docker, NVIDIA Container Toolkit, and NVIDIA drivers installed on the host system.
Download features for the targeted GPUs.
Note
This sample downloads the model files from NGC and embeds them in the container. Although doing so is not required for containerization, we highly recommend having the models pre-downloaded inside the container. Downloading the models after the container is launched might not be optimal because the time required for the container to be ready (including downloading the required models) can vary.
Change the current working directory to
samples/container:cd samples/container.Build container (takes a few minutes):
./build_container_image.shThe built container will have the SDK with downloaded models copied to
/opt/nvidia/maxine/Audio_Effects_SDK.
Create a folder for container output:
mkdir outRun the container mapping output folder using
-m. (The path must not end with/.) This starts a new prompt inside the container:./run_container_image.sh -m out
Change the working directory to
samples/effects_demoand run the effects_demo sample for any effect.Copy the output to
/host(which is mapped to the output folder using-m):root@d3a064d21267:/opt/nvidia/maxine/Audio_Effects_SDK# cd samples/effects_demo/ root@d3a064d21267:/opt/nvidia/maxine/Audio_Effects_SDK/samples/effects_demo# ./run_effect.sh -g a16 -e denoiser -s 48 ... root@d3a064d21267:/opt/nvidia/maxine/Audio_Effects_SDK/samples/effects_demo# cp -r denoiser/ /host/ root@d3a064d21267:/opt/nvidia/maxine/Audio_Effects_SDK/samples/effects_demo# exit
The output will be present on the host system under the mapped folder (
outin the preceding example):ls out