From 06e1c2dd829916eac041f5f18712a7deac29bdb2 Mon Sep 17 00:00:00 2001 From: AimOff Date: Wed, 20 Nov 2024 00:57:50 +0900 Subject: [PATCH] Update default to ROCm 6.2 * Add Ubuntu 24.04 stuffs * Update default to Ubuntu 24.04 and ROCm 6.2 * Add USER_NAME argument --- .env | 6 +- build.sh | 6 +- dev/Dockerfile-ubuntu-22.04 | 6 +- dev/Dockerfile-ubuntu-24.04 | 30 ++++++++ dev/Dockerfile-ubuntu-24.04-complete | 1 + dev/Dockerfile-ubuntu-24.04-complete-sdk | 1 + dev/Dockerfile-ubuntu-24.04-hip | 1 + dev/Dockerfile-ubuntu-24.04-hip-sdk | 1 + dev/Dockerfile-ubuntu-24.04-ml | 1 + dev/Dockerfile-ubuntu-24.04-ml-sdk | 1 + dev/Dockerfile-ubuntu-24.04-opencl | 1 + dev/Dockerfile-ubuntu-24.04-opencl-sdk | 1 + dev/Dockerfile-ubuntu-24.04-openmp-sdk | 1 + dev/{90-rocm-jammy => rocm-pin-600} | 2 +- docker-compose.yml | 50 ++++++------- rocm-terminal/Dockerfile-ubuntu-20.04 | 11 +-- rocm-terminal/Dockerfile-ubuntu-20.04-x11 | 7 +- rocm-terminal/Dockerfile-ubuntu-22.04 | 13 ++-- rocm-terminal/Dockerfile-ubuntu-22.04-x11 | 13 ++-- rocm-terminal/Dockerfile-ubuntu-24.04 | 82 +++++++++++++++++++++ rocm-terminal/Dockerfile-ubuntu-24.04-x11 | 90 +++++++++++++++++++++++ 21 files changed, 269 insertions(+), 56 deletions(-) create mode 100644 dev/Dockerfile-ubuntu-24.04 create mode 120000 dev/Dockerfile-ubuntu-24.04-complete create mode 120000 dev/Dockerfile-ubuntu-24.04-complete-sdk create mode 120000 dev/Dockerfile-ubuntu-24.04-hip create mode 120000 dev/Dockerfile-ubuntu-24.04-hip-sdk create mode 120000 dev/Dockerfile-ubuntu-24.04-ml create mode 120000 dev/Dockerfile-ubuntu-24.04-ml-sdk create mode 120000 dev/Dockerfile-ubuntu-24.04-opencl create mode 120000 dev/Dockerfile-ubuntu-24.04-opencl-sdk create mode 120000 dev/Dockerfile-ubuntu-24.04-openmp-sdk rename dev/{90-rocm-jammy => rocm-pin-600} (60%) create mode 100644 rocm-terminal/Dockerfile-ubuntu-24.04 create mode 100644 rocm-terminal/Dockerfile-ubuntu-24.04-x11 diff --git a/.env b/.env index 3a6db62..c27fc8c 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ -OS_VARIANT=ubuntu-22.04 -ROCM_VERSION=6.1 -AMDGPU_VERSION=6.1 +OS_VARIANT=ubuntu-24.04 +ROCM_VERSION=6.2 +AMDGPU_VERSION=6.2 TERM_FLAVOR=-complete-sdk XTERM_FLAVOR=-complete UID= diff --git a/build.sh b/build.sh index b3fa56c..ea4ae83 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,10 @@ #!/bin/sh OS=${OS:-ubuntu} -OS_VERSION=${OS_VERSION:-22.04} +OS_VERSION=${OS_VERSION:-24.04} OS_VARIANT=${OS_VARIANT:-${OS}-${OS_VERSION}} -ROCM_VERSION=${ROCM_VERSION:-6.1} -AMDGPU_VERSION=${AMDGPU_VERSION:-6.1} +ROCM_VERSION=${ROCM_VERSION:-6.2} +AMDGPU_VERSION=${AMDGPU_VERSION:-6.2} #TERM_FLAVOR="" TERM_FLAVOR="-complete-sdk" XTERM_FLAVOR="-complete" diff --git a/dev/Dockerfile-ubuntu-22.04 b/dev/Dockerfile-ubuntu-22.04 index 506a0ab..885a05f 100644 --- a/dev/Dockerfile-ubuntu-22.04 +++ b/dev/Dockerfile-ubuntu-22.04 @@ -4,8 +4,8 @@ FROM ubuntu:22.04 # Register the ROCM package repository, and install rocm-dev package -ARG ROCM_VERSION=6.1 -ARG AMDGPU_VERSION=6.1 +ARG ROCM_VERSION=6.2 +ARG AMDGPU_VERSION=6.2 RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-utils \ @@ -15,7 +15,7 @@ RUN apt-get update \ && echo "deb [arch=amd64] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu jammy main" | tee /etc/apt/sources.list.d/amdgpu.list \ && DEBIAN_FRONTEND=noninteractive apt-get purge -y curl gnupg \ && DEBIAN_FRONTEND=noninteractive apt-get --purge -y autoremove -COPY 90-rocm-jammy /etc/apt/preferences.d/ +COPY rocm-pin-600 /etc/apt/preferences.d/ RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ diff --git a/dev/Dockerfile-ubuntu-24.04 b/dev/Dockerfile-ubuntu-24.04 new file mode 100644 index 0000000..5270dac --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04 @@ -0,0 +1,30 @@ +# This dockerfile is meant to serve as a rocm base image. +# It registers the debian rocm package repository, and installs the rocm-language-runtime package. + +FROM ubuntu:24.04 + +# Register the ROCM package repository, and install rocm-dev package +ARG ROCM_VERSION=6.2 +ARG AMDGPU_VERSION=6.2 + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-utils \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl gnupg \ + && curl -sL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/rocm.gpg \ + && echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/$ROCM_VERSION noble main" | tee /etc/apt/sources.list.d/rocm.list \ + && echo "deb [arch=amd64] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu noble main" | tee /etc/apt/sources.list.d/amdgpu.list \ + && DEBIAN_FRONTEND=noninteractive apt-get purge -y curl gnupg \ + && DEBIAN_FRONTEND=noninteractive apt-get --purge -y autoremove +COPY rocm-pin-600 /etc/apt/preferences.d/ + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + sudo \ + libelf1t64 \ + kmod \ + file \ + python3 \ + rocm-language-runtime \ + rocminfo \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* diff --git a/dev/Dockerfile-ubuntu-24.04-complete b/dev/Dockerfile-ubuntu-24.04-complete new file mode 120000 index 0000000..2adbe85 --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-complete @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-complete \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-complete-sdk b/dev/Dockerfile-ubuntu-24.04-complete-sdk new file mode 120000 index 0000000..3488fff --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-complete-sdk @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-complete-sdk \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-hip b/dev/Dockerfile-ubuntu-24.04-hip new file mode 120000 index 0000000..31c6c69 --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-hip @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-hip \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-hip-sdk b/dev/Dockerfile-ubuntu-24.04-hip-sdk new file mode 120000 index 0000000..d08a14c --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-hip-sdk @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-hip-sdk \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-ml b/dev/Dockerfile-ubuntu-24.04-ml new file mode 120000 index 0000000..00880db --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-ml @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-ml \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-ml-sdk b/dev/Dockerfile-ubuntu-24.04-ml-sdk new file mode 120000 index 0000000..8a6a71f --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-ml-sdk @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-ml-sdk \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-opencl b/dev/Dockerfile-ubuntu-24.04-opencl new file mode 120000 index 0000000..a9049ca --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-opencl @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-opencl \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-opencl-sdk b/dev/Dockerfile-ubuntu-24.04-opencl-sdk new file mode 120000 index 0000000..2a2961f --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-opencl-sdk @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-opencl-sdk \ No newline at end of file diff --git a/dev/Dockerfile-ubuntu-24.04-openmp-sdk b/dev/Dockerfile-ubuntu-24.04-openmp-sdk new file mode 120000 index 0000000..71da650 --- /dev/null +++ b/dev/Dockerfile-ubuntu-24.04-openmp-sdk @@ -0,0 +1 @@ +Dockerfile-ubuntu-22.04-openmp-sdk \ No newline at end of file diff --git a/dev/90-rocm-jammy b/dev/rocm-pin-600 similarity index 60% rename from dev/90-rocm-jammy rename to dev/rocm-pin-600 index 902abc9..01a6502 100644 --- a/dev/90-rocm-jammy +++ b/dev/rocm-pin-600 @@ -1,4 +1,4 @@ Explanation: ROCm APT Repository Package: * -Pin: release o=repo.radeon.com, n=jammy +Pin: release o=repo.radeon.com Pin-Priority: 600 diff --git a/docker-compose.yml b/docker-compose.yml index 2421b74..d977e30 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,12 @@ -version: '3' - services: # The following defines application containers, which depend on the data-only # containers defined above to provide their software layers # These should be run with `docker-compose run --rm ` base: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest} + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest} build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04} + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04} args: ROCM_VERSION: ${ROCM_VERSION} AMDGPU_VERSION: ${AMDGPU_VERSION} @@ -19,10 +17,10 @@ services: - /tmp hip: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-hip + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-hip build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-hip + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-hip args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -33,10 +31,10 @@ services: - /tmp hip-sdk: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-hip-sdk + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-hip-sdk build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-hip-sdk + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-hip-sdk args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -47,10 +45,10 @@ services: - /tmp ml: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-ml + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-ml build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-ml + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-ml args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -61,10 +59,10 @@ services: - /tmp ml-sdk: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-ml-sdk + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-ml-sdk build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-ml-sdk + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-ml-sdk args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -75,10 +73,10 @@ services: - /tmp opencl: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-opencl + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-opencl build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-opencl + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-opencl args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -89,10 +87,10 @@ services: - /tmp opencl-sdk: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-opencl-sdk + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-opencl-sdk build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-opencl-sdk + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-opencl-sdk args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -103,10 +101,10 @@ services: - /tmp openmp-sdk: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-openmp-sdk + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-openmp-sdk build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-openmp-sdk + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-openmp-sdk args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -117,10 +115,10 @@ services: - /tmp complete: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-complete + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-complete build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-complete + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-complete args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -131,10 +129,10 @@ services: - /tmp complete-sdk: - image: rocm/dev-${OS_VARIANT:-ubuntu-22.04}:${ROCM_VERSION:-latest}-complete-sdk + image: rocm/dev-${OS_VARIANT:-ubuntu-24.04}:${ROCM_VERSION:-latest}-complete-sdk build: context: ./dev - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-complete-sdk + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-complete-sdk args: OS_VARIANT: ${OS_VARIANT} ROCM_VERSION: ${ROCM_VERSION} @@ -145,10 +143,10 @@ services: - /tmp term: - image: rocm/rocm-terminal:${ROCM_VERSION:-latest} + image: rocm/rocm-terminal:${ROCM_VERSION:-latest}-${OS_VARIANT:-ubuntu-24.04} build: context: ./rocm-terminal - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04} + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04} args: ROCM_VERSION: ${ROCM_VERSION} TERM_FLAVOR: ${TERM_FLAVOR:-complete-sdk} @@ -165,10 +163,10 @@ services: - /tmp:/tmp xterm: - image: rocm/rocm-terminal:${ROCM_VERSION:-latest}-x11 + image: rocm/rocm-terminal:${ROCM_VERSION:-latest}-${OS_VARIANT:-ubuntu-24.04}-x11 build: context: ./rocm-terminal - dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-22.04}-x11 + dockerfile: Dockerfile-${OS_VARIANT:-ubuntu-24.04}-x11 args: ROCM_VERSION: ${ROCM_VERSION} TERM_FLAVOR: ${XTERM_FLAVOR:-complete} diff --git a/rocm-terminal/Dockerfile-ubuntu-20.04 b/rocm-terminal/Dockerfile-ubuntu-20.04 index 8455564..d0c3f19 100644 --- a/rocm-terminal/Dockerfile-ubuntu-20.04 +++ b/rocm-terminal/Dockerfile-ubuntu-20.04 @@ -12,6 +12,7 @@ ARG ROCM_VERSION=6.1 ARG TERM_FLAVOR +ARG USER_NAME=rocm-user FROM rocm/dev-ubuntu-20.04:${ROCM_VERSION}${TERM_FLAVOR} @@ -37,17 +38,17 @@ RUN apt-get clean \ COPY sudo-nopasswd /etc/sudoers.d/sudo-nopasswd # This is meant to be used as an interactive developer container -# Create user rocm-user as member of sudo group +# Create user $USER_NAME as member of sudo group # Append /opt/rocm/bin to the system PATH variable RUN UID_ADD=; [ -z "$UID" ] || UID_ADD="-u $UID"; \ if [ -z "$RENDER_GID" ]; then \ - useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash rocm-user; \ + useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash $USER_NAME; \ else \ groupadd -g $RENDER_GID render; \ - useradd --create-home $UID_ADD -G sudo,video,render --shell /bin/bash rocm-user; \ + useradd --create-home $UID_ADD -G sudo,video,render --shell /bin/bash $USER_NAME; \ fi -USER rocm-user -WORKDIR /home/rocm-user +USER $USER_NAME +WORKDIR /home/$USER_NAME ENV PATH "${PATH}:/opt/rocm/bin" # The following are optional enhancements for the command-line experience diff --git a/rocm-terminal/Dockerfile-ubuntu-20.04-x11 b/rocm-terminal/Dockerfile-ubuntu-20.04-x11 index 4d7c183..b69fb2d 100644 --- a/rocm-terminal/Dockerfile-ubuntu-20.04-x11 +++ b/rocm-terminal/Dockerfile-ubuntu-20.04-x11 @@ -12,6 +12,7 @@ ARG ROCM_VERSION=6.1 ARG TERM_FLAVOR +ARG USER_NAME=rocm-user FROM rocm/dev-ubuntu-20.04:${ROCM_VERSION}${TERM_FLAVOR} @@ -28,7 +29,7 @@ RUN apt-get update \ python3-venv # This is meant to be used as an interactive developer container -# Create user rocm-user as member of sudo group +# Create user $USER_NAME as member of sudo group RUN UID_ADD=; [ -z "$UID" ] || UID_ADD="-u $UID"; \ if [ -z "$RENDER_GID" ]; then \ useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash rocm-user; \ @@ -66,8 +67,8 @@ COPY start-dbus.sh /usr/local/bin RUN chmod +x /usr/local/bin/start-dbus.sh # Append /opt/rocm/bin to the system PATH variable -USER rocm-user -WORKDIR /home/rocm-user +USER $USER_NAME +WORKDIR /home/$USER_NAME ENV PATH "${PATH}:/opt/rocm/bin" # The following are optional enhancements for the command-line experience diff --git a/rocm-terminal/Dockerfile-ubuntu-22.04 b/rocm-terminal/Dockerfile-ubuntu-22.04 index 9389634..425e4ee 100644 --- a/rocm-terminal/Dockerfile-ubuntu-22.04 +++ b/rocm-terminal/Dockerfile-ubuntu-22.04 @@ -10,13 +10,14 @@ # If it is desired to run the container manually through the docker command-line, the following is an example # 'docker run -it --rm -v [host/directory]:[container/directory]:ro /'. -ARG ROCM_VERSION=6.1 +ARG ROCM_VERSION=6.2 ARG TERM_FLAVOR FROM rocm/dev-ubuntu-22.04:${ROCM_VERSION}${TERM_FLAVOR} ARG UID ARG RENDER_GID +ARG USER_NAME=rocm-user # Initialize the image # Modify to pre-install dev tools and ROCm packages @@ -39,17 +40,17 @@ RUN apt-get clean \ COPY sudo-nopasswd /etc/sudoers.d/sudo-nopasswd # This is meant to be used as an interactive developer container -# Create user rocm-user as member of sudo group +# Create user $USER_NAME as member of sudo group # Append /opt/rocm/bin to the system PATH variable RUN UID_ADD=; [ -z "$UID" ] || UID_ADD="-u $UID"; \ if [ -z "$RENDER_GID" ]; then \ - useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash rocm-user; \ + useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash $USER_NAME; \ else \ groupadd -g $RENDER_GID render; \ - useradd --create-home $UID_ADD -G sudo,video,render --shell /bin/bash rocm-user; \ + useradd --create-home $UID_ADD -G sudo,video,render --shell /bin/bash $USER_NAME; \ fi -USER rocm-user -WORKDIR /home/rocm-user +USER $USER_NAME +WORKDIR /home/$USER_NAME ENV PATH "${PATH}:/opt/rocm/bin" # The following are optional enhancements for the command-line experience diff --git a/rocm-terminal/Dockerfile-ubuntu-22.04-x11 b/rocm-terminal/Dockerfile-ubuntu-22.04-x11 index b6c3b4e..043c9fe 100644 --- a/rocm-terminal/Dockerfile-ubuntu-22.04-x11 +++ b/rocm-terminal/Dockerfile-ubuntu-22.04-x11 @@ -10,13 +10,14 @@ # If it is desired to run the container manually through the docker command-line, the following is an example # 'docker run -it --rm -v [host/directory]:[container/directory]:ro /'. -ARG ROCM_VERSION=6.1 +ARG ROCM_VERSION=6.2 ARG TERM_FLAVOR FROM rocm/dev-ubuntu-22.04:${ROCM_VERSION}${TERM_FLAVOR} ARG UID ARG RENDER_GID +ARG USER_NAME=rocm-user # Initialize the image # Modify to pre-install dev tools and ROCm packages @@ -28,13 +29,13 @@ RUN apt-get update \ python3-venv # This is meant to be used as an interactive developer container -# Create user rocm-user as member of sudo group +# Create user $USER_NAME as member of sudo group RUN UID_ADD=; [ -z "$UID" ] || UID_ADD="-u $UID"; \ if [ -z "$RENDER_GID" ]; then \ - useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash rocm-user; \ + useradd --create-home $UID_ADD -G sudo,video --shell /bin/bash $USER_NAME; \ else \ groupadd -g $RENDER_GID render; \ - useradd --create-home $UID_ADD -G sudo,video,render --shell /bin/bash rocm-user; \ + useradd --create-home $UID_ADD -G sudo,video,render --shell /bin/bash $USER_NAME; \ fi # Modify to pre-install X11 related tools and user space drivers @@ -64,8 +65,8 @@ COPY start-dbus.sh /usr/local/bin RUN chmod +x /usr/local/bin/start-dbus.sh # Append /opt/rocm/bin to the system PATH variable -USER rocm-user -WORKDIR /home/rocm-user +USER $USER_NAME +WORKDIR /home/$USER_NAME ENV PATH "${PATH}:/opt/rocm/bin" # The following are optional enhancements for the command-line experience diff --git a/rocm-terminal/Dockerfile-ubuntu-24.04 b/rocm-terminal/Dockerfile-ubuntu-24.04 new file mode 100644 index 0000000..0f13465 --- /dev/null +++ b/rocm-terminal/Dockerfile-ubuntu-24.04 @@ -0,0 +1,82 @@ +# This dockerfile is meant to be personalized, and serves as a template and demonstration. +# Modify it directly, but it is recommended to copy this dockerfile into a new build context (directory), +# modify to taste and modify docker-compose.yml.template to build and run it. + +# It is recommended to control docker containers through 'docker-compose' https://docs.docker.com/compose/ +# Docker compose depends on a .yml file to control container sets +# rocm-setup.sh can generate a useful docker-compose .yml file +# `docker-compose run --rm ` + +# If it is desired to run the container manually through the docker command-line, the following is an example +# 'docker run -it --rm -v [host/directory]:[container/directory]:ro /'. + +ARG ROCM_VERSION=6.2 +ARG TERM_FLAVOR + +FROM rocm/dev-ubuntu-24.04:${ROCM_VERSION}${TERM_FLAVOR} + +ARG UID +ARG RENDER_GID +ARG USER_NAME=rocm-user + +# Initialize the image +# Modify to pre-install dev tools and ROCm packages +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + git \ + vim-nox \ + less \ + cmake-curses-gui \ + python3-pip \ + python3-venv \ + libgulkan-dev \ + libplacebo-dev \ + rocm-developer-tools +RUN apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Grant members of 'sudo' group passwordless privileges +# Comment out to require sudo +COPY sudo-nopasswd /etc/sudoers.d/sudo-nopasswd + +# This is meant to be used as an interactive developer container +# Create user $USER_NAME or rename existing "ubuntu" user +# Append /opt/rocm/bin to the system PATH variable +RUN if [ -n "$RENDER_GID" ]; then \ + groupadd -g $RENDER_GID render; \ + if [ -n "$UID" ]; then \ + if [ "$UID" -eq 1000 ]; then \ + usermod -l $USER_NAME ubuntu; \ + usermod -md /home/$USER_NAME $USER_NAME; \ + usermod -aG render $USER_NAME; \ + else \ + useradd --create-home -u $UID -G sudo,video,render --shell /bin/bash $USER_NAME; \ + fi; \ + else \ + useradd --create-home -G sudo,video,render --shell /bin/bash $USER_NAME; \ + fi; \ + else \ + if [ -n "$UID" ]; then \ + if [ "$UID" -eq 1000 ]; then \ + usermod -l $USER_NAME ubuntu; \ + usermod -md /home/$USER_NAME $USER_NAME; \ + else \ + useradd --create-home -u $UID -G sudo,video --shell /bin/bash $USER_NAME; \ + fi; \ + else \ + useradd --create-home -G sudo,video --shell /bin/bash $USER_NAME; \ + fi; \ + fi +USER $USER_NAME +WORKDIR /home/$USER_NAME +ENV PATH "${PATH}:/opt/rocm/bin" + +# The following are optional enhancements for the command-line experience +# Uncomment the following to install a pre-configured vim environment based on http://vim.spf13.com/ +# 1. Sets up an enhanced command line dev environment within VIM +# 2. Aliases GDB to enable TUI mode by default +#RUN curl -sL https://j.mp/spf13-vim3 | bash && \ +# echo "alias gdb='gdb --tui'\n" >> ~/.bashrc + +# Default to a login shell +CMD ["bash", "-l"] diff --git a/rocm-terminal/Dockerfile-ubuntu-24.04-x11 b/rocm-terminal/Dockerfile-ubuntu-24.04-x11 new file mode 100644 index 0000000..b300ddd --- /dev/null +++ b/rocm-terminal/Dockerfile-ubuntu-24.04-x11 @@ -0,0 +1,90 @@ +# This dockerfile is meant to be personalized, and serves as a template and demonstration. +# Modify it directly, but it is recommended to copy this dockerfile into a new build context (directory), +# modify to taste and modify docker-compose.yml.template to build and run it. + +# It is recommended to control docker containers through 'docker-compose' https://docs.docker.com/compose/ +# Docker compose depends on a .yml file to control container sets +# rocm-setup.sh can generate a useful docker-compose .yml file +# `docker-compose run --rm ` + +# If it is desired to run the container manually through the docker command-line, the following is an example +# 'docker run -it --rm -v [host/directory]:[container/directory]:ro /'. + +ARG ROCM_VERSION=6.2 +ARG TERM_FLAVOR + +FROM rocm/dev-ubuntu-24.04:${ROCM_VERSION}${TERM_FLAVOR} + +ARG UID +ARG RENDER_GID +ARG USER_NAME=rocm-user + +# Initialize the image +# Modify to pre-install dev tools and ROCm packages +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + git \ + vim-nox \ + less \ + python3-venv + +# Modify to pre-install X11 related tools and user space drivers +# These packages are installed after render group has been added +# because a depending package would add render group with specific GID +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + mesa-vulkan-drivers \ + vulkan-tools \ + libgulkan-utils \ + libgl1-amdgpu-mesa-dri \ + vainfo \ + xserver-xorg-amdgpu-video-amdgpu \ + x11-apps \ + dbus-x11 \ + mesa-utils \ + pulseaudio \ + fuse +RUN apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Grant members of 'sudo' group passwordless privileges +# Comment out to require sudo +COPY sudo-nopasswd /etc/sudoers.d/sudo-nopasswd + +# This is meant to be used as an interactive developer container +# Create user $USER_NAME or rename existing "ubuntu" user +RUN if [ -n "$RENDER_GID" ]; then \ + CUR_RENDER_GID=$(getent group render | cut --delimiter ':' --fields 3); \ + if [ $RENDER_GID -ne $CUR_RENDER_GID ]; then \ + groupmod -g $RENDER_GID render; \ + fi; \ + fi; \ + if [ -n "$UID" ]; then \ + if [ "$UID" -eq 1000 ]; then \ + usermod -l $USER_NAME ubuntu; \ + usermod -md /home/$USER_NAME $USER_NAME; \ + usermod -aG render $USER_NAME; \ + else \ + useradd --create-home -u $UID -G sudo,video,render --shell /bin/bash $USER_NAME; \ + fi; \ + else \ + useradd --create-home -G sudo,video,render --shell /bin/bash $USER_NAME; \ + fi + +# Make startup script to launch dbus for user session +COPY start-dbus.sh /usr/local/bin +RUN chmod +x /usr/local/bin/start-dbus.sh + +# Append /opt/rocm/bin to the system PATH variable +USER $USER_NAME +WORKDIR /home/$USER_NAME +ENV PATH "${PATH}:/opt/rocm/bin" + +# The following are optional enhancements for the command-line experience +# Uncomment the following to install a pre-configured vim environment based on http://vim.spf13.com/ +# 1. Sets up an enhanced command line dev environment within VIM +# 2. Aliases GDB to enable TUI mode by default +#RUN curl -sL https://j.mp/spf13-vim3 | bash && \ +# echo "alias gdb='gdb --tui'\n" >> ~/.bashrc + +# Default to a login shell +CMD ["/bin/sh", "/usr/local/bin/start-dbus.sh" ]