DEV Community

Adam Mateusz Brożyński
Adam Mateusz Brożyński

Posted on


nVidia 525 + Cuda 11.8 + Python 3.10 + pyTorch GPU Docker image

It is a base environment for torch with GPU support (including 3090Ti!) that can be used for working with AI models. This image requires nvidia-driver-525 and nvidia-docker2 installed on host. It needs 30GB on disk!


FROM nvidia/cuda:11.8.0-devel-ubuntu22.04


RUN apt-get update --yes --quiet && DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
    software-properties-common \
    build-essential apt-utils \
    wget curl vim git ca-certificates kmod \
    nvidia-driver-525 \
 && rm -rf /var/lib/apt/lists/*

# PYTHON 3.10
RUN add-apt-repository --yes ppa:deadsnakes/ppa && apt-get update --yes --quiet
RUN DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
    python3.10 \
    python3.10-dev \
    python3.10-distutils \
    python3.10-lib2to3 \
    python3.10-gdbm \
    python3.10-tk \

RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 999 \
    && update-alternatives --config python3 && ln -s /usr/bin/python3 /usr/bin/python

RUN pip install --upgrade pip

RUN wget -O /tmp/ \
    && bash /tmp/ -b -p /anaconda \
    && eval "$(/anaconda/bin/conda shell.bash hook)" \
    && conda init \
    && conda update -n base -c defaults conda \
    && conda create --name env \
    && conda activate env \
    && conda install -y pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
Enter fullscreen mode Exit fullscreen mode


$ docker build -t nvidia-cuda .
Enter fullscreen mode Exit fullscreen mode


$ docker run --gpus all -it nvidia-cuda
Enter fullscreen mode Exit fullscreen mode


Run inside container:

$ conda activate env
$ python
Enter fullscreen mode Exit fullscreen mode
>>> include torch
>>> torch.cuda.is_available() 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

The AI Brief

AI generated git commit messages

Minimize the struggle of remembering what you just coded. AI-generated commits make it easier to manage projects and keep track of changes. The Nutlope/aicommits project demonstrates how AI can improve commit messages.

I open sourced an AI that creates any UI in seconds

Make AI-generated user interfaces a breeze. This open-source project harnesses the power of generative AI technologies like chatGPT to create versatile, quick, and intuitive UI components.

Use AI to commit like a PRO in 1 second

Upgrade your commit message game with AI. Boost your productivity by using ChatGPT to generate commit messages and avoid context switching. OpenCommit is an open-source library that helps you achieve this easily.

Build your own ChatGPT starter kit

Train AI models on custom data for improved domain-specific knowledge. Combine the power of WebView technologies and this starter kit to train your ChatGPT model on specific websites, allowing for better-optimized outcomes.