2

I need to make docker of my server, but it works only with cuda, how can i add it in my Dockerfile?

FROM python:3.10

ENV FLASK_RUN_PORT=5000

RUN sudo nvidia-ctk runtime configure # Here

COPY . /app

WORKDIR /app

RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 5000

CMD ["python", "server.py"]

I try to do it bellow, but it doesn't work, please, help

  • check out https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container – JonSG May 26 '23 at 13:34

1 Answers1

1

You can start with a CUDA docker container and then install python, for example

FROM nvidia/cuda:12.1.1-runtime-ubuntu20.04 
RUN apt-get update && \
    apt-get install -y python3-pip python3-dev && \
    rm -rf /var/lib/apt/lists/*
Mark Chackerian
  • 21,866
  • 6
  • 108
  • 99