From 458f2fcbd811826beb61c69df71a5f9937825d0c Mon Sep 17 00:00:00 2001 From: Justin Williams Date: Thu, 5 Dec 2024 13:34:47 -0600 Subject: [PATCH] [SWDEV-479339/498804] Added AMDSMI Dockerfile Signed-off-by: Justin Williams Change-Id: Ic7cc6eb6417708cff3f4a33b91a8ef6dcd2b2807 [ROCm/amdsmi commit: 2a1e2eed189192a43ab13bcf36444113e5a32f2d] --- projects/amdsmi/Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 projects/amdsmi/Dockerfile diff --git a/projects/amdsmi/Dockerfile b/projects/amdsmi/Dockerfile new file mode 100644 index 0000000000..a79d7c0520 --- /dev/null +++ b/projects/amdsmi/Dockerfile @@ -0,0 +1,31 @@ + # Use ubuntu 20.04 base image + FROM compute-artifactory.amd.com:5000/rocm-base-images/ubuntu-20.04-bld:2024112501 + + # Set environment variables + ENV BUILD_FOLDER=/src/build + ENV DEB_BUILD="amd-smi-lib*99999-local_amd64.deb" + ENV DEB_BUILD_TEST='amd-smi-lib-tests*99999-local_amd64.deb' + + # Set up the working directory + WORKDIR /src + + # Copy the source code into the container + COPY . /src + + # Run the build and install commands + RUN rm -rf ${BUILD_FOLDER} && \ + mkdir -p ${BUILD_FOLDER} && \ + cd ${BUILD_FOLDER} && \ + cmake .. -DBUILD_TESTS=ON -DENABLE_ESMI_LIB=ON && \ + make -j $(nproc) VERBOSE=1 && \ + make package && \ + sudo apt install -y ${BUILD_FOLDER}/${DEB_BUILD} && \ + sudo ln -s /opt/rocm/bin/amd-smi /usr/local/bin + + # Verify installation + RUN python3 -m pip list | grep amd && \ + python3 -m pip list | grep pip && \ + python3 -m pip list | grep setuptools + + # Set the entrypoint + ENTRYPOINT ["/bin/bash"]