diff --git a/gpu.Dockerfile b/gpu.Dockerfile index 752bdad0..bd1069a2 100644 --- a/gpu.Dockerfile +++ b/gpu.Dockerfile @@ -36,6 +36,9 @@ COPY --from=builder /code /code # Copy the Python libraries installed via pip from the builder COPY --from=builder /usr/local /usr/local +# Install OpenCL Drivers +RUN apt install nvidia-opencl-icd-340 intel-opencl-icd + # Install shared libraries that we depend on via APT, but *not* # the -dev packages to save space! RUN bash configure.sh installruntimedepsonly \ diff --git a/opendm/gpu.py b/opendm/gpu.py index 173010c2..df288f9b 100644 --- a/opendm/gpu.py +++ b/opendm/gpu.py @@ -1,4 +1,3 @@ -import os, subprocess from opendm import log from repoze.lru import lru_cache @@ -8,8 +7,9 @@ def has_gpus(): try: platforms = pyopencl.get_platforms() - print(platforms) - exit(1) + for p in platforms: + log.ODM_INFO("Found GPU device: %s" % p.name) + + return len(platforms) > 0 except Exception as e: - print(e) return False