From 6d4b3c692679606fd4f49704460bdfddf93673c4 Mon Sep 17 00:00:00 2001 From: luis Date: Tue, 31 Jan 2023 18:12:27 -0500 Subject: [PATCH] fix can't find libcublas/libcuda error --- Dockerfile | 6 ++++++ docker-compose_nvidia-gpu.yaml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index fafabce..2375435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,12 @@ ENV PYTHONUNBUFFERED 1 ENV PYTHONPATH "${PYTHONPATH}:/" ENV PORT=8000 +ENV PATH /usr/local/cuda/bin/:$PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:/usr/local/cuda/lib64 +ENV NVIDIA_VISIBLE_DEVICES all +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +LABEL com.nvidia.volumes.needed="nvidia_driver" + RUN mkdir /sukima WORKDIR /sukima diff --git a/docker-compose_nvidia-gpu.yaml b/docker-compose_nvidia-gpu.yaml index f434990..834c875 100644 --- a/docker-compose_nvidia-gpu.yaml +++ b/docker-compose_nvidia-gpu.yaml @@ -9,8 +9,10 @@ services: - conf.env ports: - "8000:8000" + runtime: nvidia volumes: - ./:/sukima/ + - /opt/cuda:/usr/local/cuda command: bash -c "alembic upgrade head && uvicorn app.main:app --reload --host 0.0.0.0 --port 8000" depends_on: - database