Skip to content

Instantly share code, notes, and snippets.

@ecaliqy
Created May 1, 2024 16:42
Show Gist options
  • Save ecaliqy/e67b9a085d184685ed455f93cdfebab9 to your computer and use it in GitHub Desktop.
Save ecaliqy/e67b9a085d184685ed455f93cdfebab9 to your computer and use it in GitHub Desktop.
Ubuntu ROCm Dev Docker
---
version: '3.5'
name: cerberus
services:
dev:
image: cerberus:5000/ecaliqy/rocm-dev:latest
restart: always
build:
dockerfile: ./docker/rocm-dev/Dockerfile
context: .
entrypoint: "jupyter notebook --ip=0.0.0.0 --port=3003"
user: ecaliqy
environment:
# https://www.reddit.com/r/ROCm/comments/17e2b5o/rocmpytorch_problem/
- HIP_VISIBLE_DEVICES=0,1,2,3,4,5
# https://www.reddit.com/r/ROCm/comments/18z29l6/rx_6650_xt_running_pytoch_on_arch_linux_possible/
- HSA_OVERRIDE_GFX_VERSION=11.0.0
- PYTORCH_ROCM_ARCH="gfx1100"
- ROCM_PATH=/opt/rocm
devices:
- "/dev/dri:/dev/dri"
- "/dev/kfd:/dev/kfd"
shm_size: '8gb'
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
working_dir: /src
ports:
- ${DEV_SSH_PORT:-3007}:22
- ${DEV_JUPYTER_PORT:-3003}:3003
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/codeexec:/src
- /mnt/sdd1:/mnt/sdd1
- /mnt/sdd2:/mnt/sdd2
- /home/ecaliqy/pcode:/home/ecaliqy/pcode
- /home/ecaliqy/3code:/home/ecaliqy/3code
- /home/ecaliqy/miniconda3:/home/ecaliqy/miniconda3
networks:
default:
name: cerberus
FROM ubuntu:22.04
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install --fix-missing -y --no-install-recommends \
openssh-client openssh-server less wget git sudo python3 python3-pip
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN apt update && apt install -y ca-certificates
RUN update-ca-certificates
# the render group on my desktop, so we want to pre-emptively add it
RUN groupadd -g 109 render
RUN wget https://repo.radeon.com/amdgpu-install/6.0/ubuntu/jammy/amdgpu-install_6.0.60000-1_all.deb
RUN apt install -y ./amdgpu-install_6.0.60000-1_all.deb && rm ./amdgpu-install_6.0.60000-1_all.deb && apt update
RUN amdgpu-install -y --usecase=rocm,rocmdevtools,lrt,opencl,openclsdk,hip,hiplibsdk,openmpsdk,mllib,mlsdk
COPY ./docker/rocm-dev/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT /entrypoint.sh
RUN groupadd --gid 1000 ecaliqy
RUN adduser --home /home/ecaliqy \
--gid 1000 --uid 1000 \
ecaliqy
RUN usermod -a -G adm,cdrom,sudo,dip,video,plugdev,render ecaliqy
RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0
RUN pip3 install --no-cache-dir tensorflow-rocm accelerate transformers
#RUN pip3 install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers
RUN pip3 install --no-cache-dir jupyter fire sentencepiece matplotlib
WORKDIR /home/ecaliqy
USER ecaliqy
#RUN mkdir -p miniconda3 && \
# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda3/miniconda.sh && \
# bash miniconda3/miniconda.sh -b -u -p miniconda3 && \
# rm -rf miniconda3/miniconda.sh && \
# ./miniconda3/bin/conda init bash && \
# ./miniconda3/bin/conda init zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment