Skip to content

Add TheRock PyTorch Dockerfile for MI300X - #511

Open
essamROCm wants to merge 3 commits into
ROCm:developfrom
essamROCm:ea/rocal-therock-mi300-container
Open

Add TheRock PyTorch Dockerfile for MI300X#511
essamROCm wants to merge 3 commits into
ROCm:developfrom
essamROCm:ea/rocal-therock-mi300-container

Conversation

@essamROCm

Copy link
Copy Markdown
Contributor

Motivation

Provide a reusable PyTorch and rocAL environment for testing on MI300X.

Technical Details

Adds a TheRock-based Dockerfile that builds rocAL and its dependencies.
The environment is application-independent and is not tied to a specific model.

Test Plan

Build the image, launch it with GPU access, and verify PyTorch GPU operations and rocAL imports.

Test Result

The image built and ran successfully on MI300X. PyTorch GPU operations and rocAL imports passed.

Signed-off-by: Essam Aly <essam.aly@amd.com>
@essamROCm essamROCm self-assigned this Aug 17, 2026
@essamROCm essamROCm added the enhancement New feature or request label Aug 17, 2026
# Install the matching TheRock distribution over the public image's userspace
# ROCm stack. Keeping everything under one prefix prevents mixed /opt/rocm and
# /workspace/install link resolution.
RUN mkdir -p "${ROCM_PATH}" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this? The base docker comes with Rocm7.14 (rock) already. Please remove this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. The base image already provides the matching ROCm 7.14 userspace stack, so downloading and overlaying another TheRock distribution is unnecessary and could result in mixed ROCm installations. I will remove the tarball installation and update the environment and build paths to use the ROCm stack from the base image.

libgoogle-glog-dev libgtk2.0-dev libjpeg-dev libjsoncpp-dev \
liblmdb-dev libomp-dev libpng-dev libsndfile1-dev libssl-dev \
libswscale-dev libtbb-dev libtbbmalloc2 libtiff-dev libtool libva-dev \
libva-drm2 make mesa-va-drivers nasm numactl perl pkg-config python3-dev \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not install mesa-va-drivers anymore, comes with theRock

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The base image already provides the VA driver through TheRock’s bundled system dependencies, so I removed mesa-va-drivers from the package installation.

&& cmake --build rapidjson/build -j"${BUILD_JOBS}" \
&& cmake --install rapidjson/build

RUN git clone --depth 1 --branch "${RPP_REF}" https://github.com/ROCm/rpp.git \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong URL for RPP. Until we bump to rocm10.1, change this to use rocm-libraries

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I updated the Dockerfile to clone ROCm/rocm-libraries and build RPP from projects/rpp instead of using the standalone ROCm/rpp repository.

&& cmake --install MIVisionX/build \
&& ldconfig

RUN git clone --depth 1 --branch "${ROCM_SYSTEMS_REF}" \

@LakshmiKumar23 LakshmiKumar23 Aug 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you cloning and building rocJPEG/rocDecode? rocm7.14 already had rocJPEG in the Rock. Remove this section

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I removed the rocJPEG and rocDecode source builds and now rely on the ROCm 7.14 components provided by the base image.

&& ldconfig

# Build optional diagnostic binaries while all source trees are available.
RUN cmake -S /workspace/rocm-systems/projects/rocjpeg/samples/jpegDecodePerf \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not build rocJPEG samples under a rocAL docker. We need this clean and bare minimum. Please remove

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I removed the rocJPEG sample and jpegDecodePerf build to keep the rocAL image minimal.

source /workspace/rocal_test_env.sh
fi

echo "===== Operating system ====="

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove these extra steps to print environment setup. The dockerfile just needs to download the base docker and add the dependencies to build rocAL over it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I removed the environment/version-reporting scripts and the additional diagnostic steps. The Dockerfile is now focused on installing the required dependencies and building rocAL.

@@ -0,0 +1,278 @@
# syntax=docker/dockerfile:1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename file to rocal-with-pytorch-therock. We do not need separate files fro each MI series

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I renamed the file to rocal-with-pytorch-therock.dockerfile and removed the MI300-specific architecture default so it can be used across supported GPU series.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants