Commit ee17b587 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Initial version of repo, compiles image for amdgpu and nvidia varients.

parent f67c0623
Pipeline #613 failed with stage
in 7 seconds
rev-git:
extends: .build-docker
only:
variables: [ $CI_COMMIT_REF_NAME == "develop" ]
variables:
REV: "git"
rev-latest:
extends: .build-docker
only:
variables: [ $CI_COMMIT_REF_NAME == "master" ]
variables:
REV: "latest"
rev-branch:
extends: .build-docker
only:
variables: [ $CI_COMMIT_REF_NAME =~ /[0-9]*.*/ ]
variables:
REV: "${CI_COMMIT_REF_NAME}"
.build-docker:
image: docker:stable image: docker:stable
services: services:
- docker:stable-dind - docker:stable-dind
variables: variables:
REPOSITORY: "aparapi/aparapi" REPOSITORY: "aparapi/aparapi"
VERSION: "2.0.0" VERSION: "2.0.0"
before_script: before_script:
- docker login -u "${DOCKER_USER}" -p "${DOCKER_TOKEN}" - echo "${DOCKER_TOKEN}" | docker login --username "${DOCKER_USER}" --password-stdin
stages: stages:
- opencl - opencl
.opencl_template: &opencl_definition .opencl_template: &opencl_definition
stage: opencl stage: opencl
script: script:
- if [ $CI_COMMIT_REF_NAME == "develop" ]; then
REV = "git";
elif [ $CI_COMMIT_REF_NAME == "master" ]; then
REV = "latest";
else
REV = "$CI_COMMIT_REF_NAME";
fi
- docker pull "${REPOSITORY}-nvidia:${REV}" || true - docker pull "${REPOSITORY}-nvidia:${REV}" || true
- docker build --network=host --pull -t "${REPOSITORY}-nvidia:${REV}" - docker build --network=host --pull -t "${REPOSITORY}-nvidia:${REV}"
--cache-from "${REPOSITORY}-nvidia:${REV}" --cache-from "${REPOSITORY}-nvidia:${REV}"
--build-arg "aparapi-ver=${VERSION}" --build-arg "aparapiver=${VERSION}"
"nvidia/" "nvidia/"
- docker pull "${REPOSITORY}-amdgpu:${REV}" || true - docker pull "${REPOSITORY}-amdgpu:${REV}" || true
- docker build --network=host --pull -t "${REPOSITORY}-amdgpu:${REV}" - docker build --network=host --pull -t "${REPOSITORY}-amdgpu:${REV}"
--cache-from "${REPOSITORY}-amdgpu:${REV}" --cache-from "${REPOSITORY}-amdgpu:${REV}"
--build-arg "aparapi-ver=${VERSION}" --build-arg "aparapiver=${VERSION}"
"amdgpu/" "amdgpu/"
- docker push "${REPOSITORY}-nvidia" - docker push "${REPOSITORY}-nvidia"
- docker push "${REPOSITORY}-amdgpu" - docker push "${REPOSITORY}-amdgpu"
only only:
-master - master
-develop - develop
-tags - tags
tags:
- general
opencl: opencl:
<<: *opencl_definition <<: *opencl_definition
# Aparapi Docker Image Changelog # Aparapi Docker Image Changelog
# 2.0.0-1
* Initial version of the docker images for amdgpu and nvidia.
...@@ -39,3 +39,13 @@ following command. ...@@ -39,3 +39,13 @@ following command.
git clone http://git.qoto.org/aparapi/aparapi-docker.git git clone http://git.qoto.org/aparapi/aparapi-docker.git
``` ```
## Building
```bash
docker build -t <image name> --build-arg "aparapiver=<aparapi Version>" amdgpu/
docker build -t <image name> --build-arg "aparapiver=<aparapi Version>" nvidia/
```
ARG aparapi-ver FROM ubuntu:20.04
FROM maven:3.6.3-openjdk-14
LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>" LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>"
ENV AMDGPUDRIVERFILE="amdgpu-pro-17.40-492261.tar.xz" #ENV AMDGPUDRIVERFILE="amdgpu-pro-17.40-492261.tar.xz"
ENV AMDGPUDIRNAME="amdgpu-pro-17.40-492261" #ENV AMDGPUDIRNAME="amdgpu-pro-17.40-492261"
ENV AMDGPUDIRNAME="amdgpu-pro-20.20-1098277-ubuntu-20.04"
ENV AMDGPUDRIVERFILE="${AMDGPUDIRNAME}.tar.xz"
WORKDIR /tmp WORKDIR /tmp
RUN dpkg --add-architecture i386 && \
apt-get update && apt-get -y dist-upgrade && \
apt-get -y --no-install-recommends install ca-certificates curl xz-utils
# only used to speedup build RUN apt-get update && \
#COPY $AMDGPUDRIVERFILE /tmp/ apt-get -y dist-upgrade && \
RUN curl -O https://download.b2go.cloud/AMD-GPU-PRO/$AMDGPUDRIVERFILE && \ rm -rf /var/lib/{cache,log}
RUN apt-get update && \
apt-get -y --no-install-recommends install \
maven \
openjdk-14-jre \
openjdk-14-jdk && \
rm -rf /var/lib/{cache,log}
RUN apt-get update && \
apt-get -y --no-install-recommends install \
ca-certificates \
wget \
xz-utils && \
wget --referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-30 https://drivers.amd.com/drivers/linux/${AMDGPUDRIVERFILE} &&\
tar -xvf $AMDGPUDRIVERFILE && rm $AMDGPUDRIVERFILE && \ tar -xvf $AMDGPUDRIVERFILE && rm $AMDGPUDRIVERFILE && \
./$AMDGPUDIRNAME/amdgpu-pro-install -y --compute && \ ./$AMDGPUDIRNAME/amdgpu-pro-install -y --compute && \
rm -rf $AMDGPUDIRNAME && \ rm -rf $AMDGPUDIRNAME && \
apt-get -y remove ca-certificates curl xz-utils && \ apt-get install -y opencl-amdgpu-pro && \
apt-get -y autoremove && apt-get clean autoclean && \ apt-get -y autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log} apt-get clean autoclean && \
rm -rf /var/lib/{apt,cache,log}
ARG aparapiver
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl="https://repo1.maven.org/maven2/" -Dartifact=com.aparapi:aparapi:${aparapiver}
#RUN dpkg --add-architecture i386 && \
# apt-get update && apt-get -y dist-upgrade && \
# apt-get -y --no-install-recommends install ca-certificates curl xz-utils
# only used to speedup build
#COPY $AMDGPUDRIVERFILE /tmp/
# curl -O https://download.b2go.cloud/AMD-GPU-PRO/$AMDGPUDRIVERFILE && \
# apt-get -y remove ca-certificates wget xz-utils && \
ARG aparapi-ver FROM ubuntu:20.04
FROM maven:3.6.3-openjdk-14
LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>" LABEL maintainer "Jeffrey Phillips Freeman <the@jeffreyfreeman.me>"
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get -y dist-upgrade && \
ocl-icd-libopencl1 \ rm -rf /var/lib/{cache,log}
ocl-icd-opencl-dev \
clinfo && \ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* apt-get -y --no-install-recommends install \
maven \
openjdk-14-jre \
openjdk-14-jdk && \
rm -rf /var/lib/{cache,log}
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
clinfo && \
apt-get -y autoremove && \
apt-get clean autoclean && \
rm -rf /var/lib/{apt,cache,log}
RUN mkdir -p /etc/OpenCL/vendors && \ RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl="https://repo1.maven.org/maven2/" -Dartifact=com.aparapi:aparapi:${aparapi-ver} ARG aparapiver
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl="https://repo1.maven.org/maven2/" -Dartifact="com.aparapi:aparapi:${aparapiver}"
# nvidia-container-runtime # nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_VISIBLE_DEVICES all
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment