Skip to content

Commit

Permalink
Get the visualize-egl container working
Browse files Browse the repository at this point in the history
Also provides a way to select the GPU-accelerated containers when
running `docker-compose up`.
  • Loading branch information
scottwittenburg committed Jul 12, 2019
1 parent 88a7d22 commit 2b3bd1b
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 14 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -26,3 +26,12 @@ If you want to stop the services you can run the command
docker-compose down
```

## Running w/ GPU accleration

In order to run compute and visualize containers which can utilize the GPU on your system:

```
docker-compose -f docker-compose.yml -f docker-compose-nvidia.yml up -d
```

This will apply the service overrides found in `docker-compose-nvidia.yml`, which make use of the `nvidia` container runtime.
39 changes: 39 additions & 0 deletions docker-compose-nvidia.yml
@@ -0,0 +1,39 @@
# Go back to an older compose format version due to a bug
# where 'runtime' is available in version 2.3 but not 3
# https://github.com/docker/compose/issues/6239
version: '2.3'
services:

compute:
image: kitware/hpccloud:nvidia-compute-pyfr
build:
context: .
dockerfile: docker/compute-pyfr/Dockerfile
args:
- BASE_IMG=kitware/hpccloud:nvidia-sge-ssh
hostname: compute
runtime: nvidia
volumes:
- scratch.hc:/scratch
networks:
- hc
ports:
- "2201:22"

visualize:
image: kitware/hpccloud:visualize-egl
build:
context: .
dockerfile: docker/visualize-egl/Dockerfile
args:
- PARAVIEW_TAG=v5.6.1
- SUPERBUILD_TAG=v5.6.1
hostname: visualize
runtime: nvidia
volumes:
- scratch.hc:/scratch
networks:
- hc
ports:
- "2202:22"
- "9090:9090"
11 changes: 7 additions & 4 deletions docker-compose.yml
@@ -1,4 +1,7 @@
version: '3'
# Go back to an older compose format version due to a bug
# where 'runtime' is available in version 2.3 but not 3
# https://github.com/docker/compose/issues/6239
version: '2.3'
services:
mongodb:
image: mongo:3.6
Expand Down Expand Up @@ -26,7 +29,7 @@ services:
depends_on:
- mongodb
environment:
- GIRDER_PORT=8080
- GIRDER_PORT=8080

command:
image: kitware/hpccloud:celery-pyfr
Expand All @@ -43,7 +46,7 @@ services:
- rabbitmq
environment:
- GIRDER_PORT=8080

monitor:
image: kitware/hpccloud:celery-pyfr
build:
Expand Down Expand Up @@ -140,4 +143,4 @@ volumes:
assetstore.hc:
keys.hc:
mongodb.hc:
scratch.hc:
scratch.hc:
19 changes: 13 additions & 6 deletions docker/visualize-egl/Dockerfile
Expand Up @@ -35,24 +35,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gfortran \
git \
libtool \
mpich \
openssl \
python2.7-dev \
python-pip \
python-setuptools \
pkg-config && \
pkg-config \
wget && \
rm -rf /var/lib/apt/lists/* && \
pip install mako

RUN mkdir -p /home/demo/cmake/3.13.4 && \
mkdir -p /home/demo/pvsb/build

COPY ./docker/visualize-egl/cmake/Docker-Ubuntu-18_04.cmake /home/demo/pvsb/Docker-Ubuntu-18_04.cmake

# Get CMake, then clone the ParaView superbuild project
RUN mkdir -p /home/demo/cmake/3.13.4 && cd /home/demo/cmake/3.13.4 && \
RUN cd /home/demo/cmake/3.13.4 && \
curl -L https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz | tar --strip-components=1 -xzv && \
mkdir -p /home/demo/pvsb && cd /home/demo/pvsb && \
cd /home/demo/pvsb && \
git clone --recursive ${SUPERBUILD_REPO} src && \
cd src && git checkout ${SUPERBUILD_TAG} && git submodule update && cd .. && \
mkdir build && cd build && \
/home/demo/cmake/3.13.4/bin/cmake -C /home/demo/pvsb/src/cmake/sites/Docker-Ubuntu-18_04.cmake "-GUnix Makefiles" ../src && \
cd build && \
/home/demo/cmake/3.13.4/bin/cmake -C /home/demo/pvsb/Docker-Ubuntu-18_04.cmake "-GUnix Makefiles" ../src && \
make -j"$(nproc)" install && \
if [ "${DEV_BUILD}" != "true" ] ; then rm -rf /home/demo/pvsb && rm -rf /home/demo/cmake ; fi
rm -rf /home/demo/pvsb && rm -rf /home/demo/cmake

WORKDIR /opt/paraview

Expand Down
6 changes: 3 additions & 3 deletions docker/visualize-egl/cmake/Docker-Ubuntu-18_04.cmake
Expand Up @@ -18,10 +18,10 @@ set(EGL_LIBRARY "/usr/lib/x86_64-linux-gnu/libEGL.so" CACHE FILEPATH "")
set(EGL_gldispatch_LIBRARY "/usr/lib/x86_64-linux-gnu/libGLdispatch.so" CACHE FILEPATH "")
set(EGL_opengl_LIBRARY "/usr/lib/x86_64-linux-gnu/libOpenGL.so" CACHE FILEPATH "")

set(PV_CMAKE_ARGS "-DOpenGL_GL_PREFERENCE:STRING=GLVND")
# Turn off index as it doesn't seem to work
set(ENABLE_nvidiaindex OFF CACHE BOOL "")

# If we're going to have support for EGL, index would be nice too
set(ENABLE_nvidiaindex ON CACHE BOOL "")
set(PV_CMAKE_ARGS "-DOpenGL_GL_PREFERENCE:STRING=GLVND")

# General rendering/graphics options
set(ENABLE_mesa OFF CACHE BOOL "")
Expand Down
2 changes: 1 addition & 1 deletion docker/visualize-osmesa/Dockerfile
Expand Up @@ -8,7 +8,7 @@ LABEL maintainer="patrick.oleary@kitware.com" \
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
openmpi-bin \
mpich \
wget && \
apt-get clean && rm -rf /var/lib/apt/lists/*

Expand Down

0 comments on commit 2b3bd1b

Please sign in to comment.