From cd08c99e841677879e556057d2e9d3207a752feb Mon Sep 17 00:00:00 2001 From: olga <odatskov@cern.ch> Date: Tue, 26 May 2020 16:21:07 +0200 Subject: [PATCH] Adding pocl version of the simpletrack container --- .gitlab-ci.yml | 22 ++++++++++++---------- lhc/simpletrack/Dockerfile.pocl | 22 ++++++++++++++++++++++ lhc/simpletrack/README.md | 18 +++++++++++++++++- 3 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 lhc/simpletrack/Dockerfile.pocl diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c90d199..73c339d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ stages: - build -build:nvidia: +.job_template: &job_build stage: build image: name: gitlab-registry.cern.ch/ci-tools/docker-image-builder @@ -11,19 +11,21 @@ build:nvidia: name: build/$CI_COMMIT_REF_NAME only: - master + +build:nvidia: + <<: *job_build script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/lhc/simpletrack/Dockerfile.nvidia --destination ${CI_REGISTRY_IMAGE}/lhc/simpletrack:nvidia-latest build:intel: - stage: build - image: - name: gitlab-registry.cern.ch/ci-tools/docker-image-builder - entrypoint: [""] - environment: - name: build/$CI_COMMIT_REF_NAME - only: - - master + <<: *job_build + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/lhc/simpletrack/Dockerfile.intel --destination ${CI_REGISTRY_IMAGE}/lhc/simpletrack:intel-latest + +build:pocl: + <<: *job_build script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/lhc/simpletrack/Dockerfile.intel --destination ${CI_REGISTRY_IMAGE}/lhc/simpletrack:intel-latest \ No newline at end of file + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/lhc/simpletrack/Dockerfile.pocl --destination ${CI_REGISTRY_IMAGE}/lhc/simpletrack:pocl-latest diff --git a/lhc/simpletrack/Dockerfile.pocl b/lhc/simpletrack/Dockerfile.pocl new file mode 100644 index 0000000..635ec1b --- /dev/null +++ b/lhc/simpletrack/Dockerfile.pocl @@ -0,0 +1,22 @@ +FROM debian:latest + +ARG LLVM_VERSION=7 +ENV OCL_ICD_VENDORS=/pocl/build/ocl-vendors +ENV POCL_BUILDING=1 + +ENV PARTICLES 20000 +ENV TURNS 15 +ENV DEVICE "0.0" + +RUN apt update && apt upgrade -y \ + && apt-get install -y build-essential ocl-icd-libopencl1 cmake git gcc g++ libhwloc5 pkg-config python3-pip libclang-${LLVM_VERSION}-dev clang-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev make ninja-build ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo + +RUN git clone https://github.com/pocl/pocl.git \ + && cd pocl && mkdir build && cd build && cmake -G Ninja .. \ + && ninja + +RUN mkdir /.cache && chmod -R 777 /.cache/ \ + && git clone https://github.com/rdemaria/simpletrack.git \ + && cd simpletrack && pip3 install pyopencl && pip3 install -e . + +ENTRYPOINT [ "/bin/bash", "-c", "cd /simpletrack/examples/lhc/ && python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $DEVICE" ] diff --git a/lhc/simpletrack/README.md b/lhc/simpletrack/README.md index 64df56d..0d65596 100644 --- a/lhc/simpletrack/README.md +++ b/lhc/simpletrack/README.md @@ -1,6 +1,10 @@ # SimpleTrack -Docker images meant to build versions with the simpletrack benchmark for nvidia GPU and intel runtimes. +Docker images meant to build versions with the simpletrack benchmark for nvidia GPU and intel and pocl runtimes. To be specify custom number of particles and turns use the environment variables: + +``` +~$ docker run --rm -e PARTICLES=100 -e TURNS=5 gitlab-registry.cern.ch/hep-workloads-gpu/... +``` * __Nvidia__: To run the benchmark through the container image entrypoint make sure to enable GPU passthrough. @@ -13,3 +17,15 @@ Docker images meant to build versions with the simpletrack benchmark for nvidia ``` ~$ docker run --rm --device /dev/dri:/dev/dri gitlab-registry.cern.ch/hep-benchmarks/hep-workloads-gpu/lhc/simpletrack:intel-latest ``` + +* __POCL__: Portable Computing Language with built ICD extensions of OpenCL. Example execution using the cpu device: + +``` +~$ docker run --rm gitlab-registry.cern.ch/hep-benchmarks/hep-workloads-gpu/lhc/simpletrack:pocl-latest +``` + +To check for available devices: + +``` +~$ docker run --rm --entrypoint "/usr/bin/clinfo" gitlab-registry.cern.ch/hep-benchmarks/hep-workloads-gpu/lhc/simpletrack:pocl-latest +``` -- GitLab