forked from florianroesler/dopencl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_ubuntu_worker
28 lines (22 loc) · 976 Bytes
/
Dockerfile_ubuntu_worker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM dopencl_ubuntu
RUN apt-get update && apt-get install -y --no-install-recommends \
ocl-icd-libopencl1 gdb \
&& rm -rf /var/lib/apt/lists/*
# OpenCL runtime for nvidia-docker. Based on the nvidia/opencl DockerHub image
# See https://gitlab.com/nvidia/container-images/opencl/blob/ubuntu18.04/runtime/Dockerfile
RUN mkdir -p /etc/OpenCL/vendors \
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
# Run worker program on the container (will require OpenCL inside, e.g. with nvidia-docker)
EXPOSE 25025 25125
RUN printf '#!/bin/sh\n\
. /etc/profile.d/dopenclenv.sh\n\
dcld 0.0.0.0\n' > launchscript.sh \
&& chmod +x launchscript.sh
RUN printf '#!/bin/sh\n\
. /etc/profile.d/dopenclenv.sh\n\
gdb -ex=run --args env DCL_LOG_LEVEL=VERBOSE dcld 0.0.0.0\n' > launchscript_debug.sh \
&& chmod +x launchscript_debug.sh
CMD ["/launchscript.sh"]