1240b592a5
* Update README-doc.md Correct GitHub URL for components moved into rocm-systems * Update amd_clr.rst Update github.com URLs * Update Dockerfile Update rocm-systems paths * Update CONTRIBUTING.md update for rocm-systems * Update CONTRIBUTING.md minor change * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update hip_runtime_api.rst Update for rocm-systems * Update installation.rst update URL to libhsakmt * Update what_is_hip.rst * Update projects/clr/CONTRIBUTING.md Co-authored-by: Dominic Widdows <dwiddows@gmail.com> * Update projects/clr/README-doc.md Co-authored-by: Dominic Widdows <dwiddows@gmail.com> * Update Dockerfile Update git clone for sparse checkout * Update projects/hip/CONTRIBUTING.md * Update projects/clr/CONTRIBUTING.md * Update projects/hipother/CONTRIBUTING.md --------- Co-authored-by: Dominic Widdows <dwiddows@gmail.com>
42 baris
1.5 KiB
Docker
42 baris
1.5 KiB
Docker
# Use rocm/dev-ubuntu-22.04 as the base image
|
|
FROM rocm/dev-ubuntu-22.04
|
|
|
|
# Set environment variables for build directories and package patterns
|
|
ENV BUILD_FOLDER=/home/rocm-systems/projects/amdsmi/build
|
|
ENV DEB_BUILD="amd-smi-lib*99999-local_amd64.deb"
|
|
ENV DEB_BUILD_TEST="amd-smi-lib-tests*99999-local_amd64.deb"
|
|
|
|
# Set the working directory to /home
|
|
WORKDIR /home
|
|
|
|
# Install necessary system packages
|
|
RUN apt update && apt-get install -y git build-essential rpm pkg-config g++ python3 python3-pip python3-wheel python3-setuptools
|
|
|
|
# Upgrade pip and install cmake and virtualenv using pip
|
|
RUN python3 -m pip install --upgrade pip setuptools && \
|
|
python3 -m pip install cmake virtualenv
|
|
|
|
# Clone the AMD SMI repository from GitHub using sparse checkout
|
|
RUN git clone --filter=blob:none --sparse -b develop https://github.com/ROCm/rocm-systems.git && \
|
|
cd rocm-systems && \
|
|
git sparse-checkout set projects/amdsmi
|
|
|
|
# Navigate to the amdsmi directory
|
|
WORKDIR /home/rocm-systems/projects/amdsmi
|
|
|
|
# Build and Install AMDSMI
|
|
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 --allow-downgrades ${BUILD_FOLDER}/${DEB_BUILD} && \
|
|
sudo ln -s /opt/rocm/bin/amd-smi /usr/local/bin
|
|
|
|
# Verify the installation of Python packages related to AMD SMI
|
|
RUN python3 -m pip list | grep -E "amd|pip|setuptools"
|
|
|
|
# Set the entrypoint to bash for interactive use
|
|
ENTRYPOINT ["/bin/bash"]
|