Sign inSign up

colesbury/python-nogil-cuda

By colesbury

•Updated over 4 years ago

Image
0

420

colesbury/python-nogil-cuda repository overview

⁠Overview

This is a docker image of a modified version of Python 3.9 that supports running without the global interpreter lock (GIL). See https://github.com/colesbury/nogil⁠.

This image includes CUDA. If you do not need CUDA, use https://hub.docker.com/r/colesbury/python-nogil⁠.

The images is based on NVIDIA's CUDA 11.0 Ubuntu 20.04 image (nvidia/cuda:11.0-devel-ubuntu20.04⁠)

⁠How to use this image

⁠Create a Dockerfile in your Python app project

FROM colesbury/python-nogil-cuda

WORKDIR /usr/src/app

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

COPY . .

CMD [ "python", "./your-daemon-or-script.py" ]

You can then build and run the Docker image:

$ docker build -t my-python-app .
$ docker run --gpus all -it --rm --name my-running-app my-python-app

⁠Run a single Python script

For many simple, single file projects, you may find it inconvenient to write a complete Dockerfile. In such cases, you can run a Python script by using the Python Docker image directly:

$ docker run --gpus all -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp colesbury/python-nogil-cuda python your-daemon-or-script.py

⁠License

This container is built of the NVIDIA CUDA image, which is governed by the the NVIDIA's deep learning container license⁠.

This software contains source code provided by NVIDIA Corporation.

View license information for Python 3⁠. This Readme is modified from the official Python image⁠ documentation under an MIT license⁠.

Tag summary

Content type

Image

Digest

Size

2 GB

Last updated

over 4 years ago

docker pull colesbury/python-nogil-cuda