Home
Unchained
Product Blog

Changes to PyTorch Container Images

Dann Frazier, Staff Software Engineer, and Patrick Smyth, Staff Developer Relations Engineer

On June 30th, we're making changes to our PyTorch container images. These changes will remove the dependency on a Python virtual environment, upgrade to the latest version of PyTorch, and support a newer CUDA release with CUDA compatibility libraries for backwards compatibility. These updates make PyTorch container images easier to update, simpler to use, and more secure. Please note that these improvements are breaking changes. This post outlines the steps our customers may need to take to maintain their deployments following this update.


Python Virtual Environments


Python virtual environments (venvs) will be removed from pytorch container images. Instead, Python packages will now be installed directly into the system site-packages directory for improved simplicity and compatibility. We are making this change to address customer feedback and create consistency between pytorch and pytorch-fips images (where Python is already installed into system root).


PyTorch


Moving forward, PyTorch container images will adopt the latest versions of upstream frameworks and libraries. We plan to start with PyTorch 2.7 with CUDA 12.6 on June 30th, based on upstream release timelines. To support customers requiring older GPU drivers, we will also incorporate upstream CUDA compatibility libraries in our PyTorch container images (see below for details).


CUDA Compatibility Libraries


Going forward, if customers wish to deploy Chainguard AI Containers on platforms that remain on older CUDA driver stacks, they will need to opt-in to using the compatibility libraries by setting the LD_LIBRARY_PATH environment variable. For example, if they wish to use our upcoming cgr.dev/<ORGANIZATION>/pytorch:2-py3.12-cuda12.4-cudnn9 image on a platform with a CUDA 11.8 driver stack, they would set the following:


export LD_LIBRARY_PATH=”/usr/local/cuda-12.4/compat”


Or from the command line:


$ docker run –rm -it -e LD_LIBRARY_PATH=”/usr/local/cuda-12.4/compat” \ cgr.dev/<ORGANIZATION>/pytorch:2-py3.12-cuda12.4-cudnn9


For further details, refer to the NVIDIA CUDA Compatibility page.


Testing


Starting on April 30, 2025, Chainguard customers entitled to PyTorch container images will have access to preview container images with these changes. Preview images will be tagged with a preview tag (such as preview-py3.13-cuda12.4-cudnn9). Initially these preview container images will include PyTorch 2.6 with CUDA 12.4 support, but container images with PyTorch 2.7 with CUDA 12.6 will be made available following upstream releases. 


On June 30th, the existing tagging scheme will begin to point to these new images and the preview tags will be removed. At that time, users of our starter (publicly available) images will also be upgraded to the new images at the :latest and :latest-dev tags.


Updated Versions and Tags


Refer to the following table for specific versions and tags following the changes.


Latest Tag Timeline


Preview Tag Timeline


Versioned Tag Timeline


To our customers using our PyTorch container images, thank you. We appreciate your patience and understanding as we work to ensure a smooth transition and deliver improved simplicity and compatibility moving forward. If you have any further questions or concerns, please reach out.

Share

Ready to Lock Down Your Supply Chain?

Talk to our customer obsessed, community-driven team.

Talk to an expert