Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python3, OpenCV and ROCm Tensorflow to container #55

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ services:
- "/dev/kfd"
image: rocm/rocm-terminal
volumes:
- ..:/home/rocm-user
- ~:/usr/local/src/host-home
environment:
- DISPLAY=${DISPLAY}

rocm-from-src:
build:
Expand All @@ -79,12 +82,15 @@ services:
- "/dev/kfd"
image: rocm/rocm-terminal
volumes:
- ..:/home/rocm-user
- ~:/usr/local/src/host-home
volumes_from:
- roct-src:ro
- rocr-src:ro
- hcc-lc-src:ro
# - hcc-hsail-src:ro
environment:
- DISPLAY:${DISPLAY}

dev-ubuntu:
build:
Expand Down
42 changes: 42 additions & 0 deletions rocm-terminal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,48 @@ COPY sudo-nopasswd /etc/sudoers.d/sudo-nopasswd
RUN useradd --create-home -G sudo --shell /bin/bash rocm-user
# sed --in-place=.rocm-backup 's|^\(PATH=.*\)"$|\1:/opt/rocm/bin"|' /etc/environment

# Install Python 3
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev python3-numpy\
&& pip3 install --upgrade pip

# Install OpenCV dependencies
RUN apt-get install -y \
build-essential \
cmake \
qt5-default \
libvtk6-dev \
zlib1g-dev \
libjpeg-dev \
libwebp-dev \
libpng-dev \
libswscale-dev \
libtheora-dev \
libvorbis-dev \
libxvidcore-dev \
libx264-dev \
yasm \
libopencore-amrnb-dev \
libv4l-dev \
libxine2-dev \
libtbb-dev \
libeigen3-dev \
doxygen

# Install OpenCV
RUN git clone --depth 1 https://github.com/opencv/opencv.git /root/opencv && \
cd /root/opencv && \
mkdir build && \
cd build && \
cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON .. && \
make -j"$(nproc)" && \
make install && \
ldconfig && \
echo 'ln /dev/null /dev/raw1394' >> ~/.bashrc

# Install ROCm Tensorflow
RUN apt-get install -y rocm-libs miopen-hip cxlactivitylogger && pip3 install tensorflow-rocm

USER rocm-user
WORKDIR /home/rocm-user
ENV PATH "${PATH}:/opt/rocm/bin"
Expand Down