Cresset
Template repository to build PyTorch projects from source on any version of PyTorch/CUDA/cuDNN.
Install / Use
/learn @cresset-template/CressetREADME
Cresset: The One Template to Train Them All

TL;DR
A new MLOps system for deep learning development using Docker Compose with the aim of providing reproducible and easy-to-use interactive development environments for deep learning practitioners. Hopefully, the methods presented here will become best practice in both academia and industry.
Introductory Video (In English)
Installation on a New Host
If this is your first time using this project, follow these steps:
-
Install the NVIDIA CUDA Driver appropriate for the target host and NVIDIA GPU. If the driver has already been installed, check that the installed version is compatible with the target CUDA version. CUDA driver version mismatch is the single most common issue for new users. See the compatibility matrix for compatible versions of the CUDA driver and CUDA Toolkit.
-
Install Docker (v23.0+ is recommended) or update to a recent version compatible with Docker Compose V2. Docker incompatibility with Docker Compose V2 is another common issue for new users. Note that Windows users may use WSL (Windows Subsystem for Linux). Cresset has been tested on Windows 11 WSL2 with the Windows CUDA driver using Docker Desktop for Windows. There is no need to install a separate WSL CUDA driver or Docker for Linux inside WSL. Note that only Docker Desktop is under a commercial EULA and Docker Engine (for Linux) and Lima Docker (for Mac) are still both open-source. N.B. Windows Security real-time protection causes significant slowdown if enabled. Disable any active antivirus programs on Windows for best performance. N.B. Linux hosts may also install via this repo.
-
Install the NVIDIA Container Toolkit as specified in this link.
-
Run
make install-composeto install Docker Compose V2 for Linux hosts. Installation does not requirerootpermissions. Visit the documentation for the latest installation information. Note that Docker Compose V2 is available for WSL users with Docker Desktop by default. -
Run
make env SERVICE=(train|devel|ngc|simple)on the terminal at project root to create a basic.envfile. The.envfile provides environment variables fordocker-compose.yaml, allowing different users and machines to set their own variables as required. The Makefile has also been configured to read values from the.envfile if it exists, allowing non-default values to be specified only once. Each host should have a separate.envfile for host-specific configurations. -
Run
make overto create adocker-compose.override.yamlfile. Add configurations that should not be shared via source control there. For example, volume-mount pairs specific to each host machine. -
If Cresset is being placed within a pre-existing project's subdirectory, change the
volumepairing from.:${PROJECT_ROOT}to..:${PROJECT_ROOT}. All commands in Cresset assume that they are being run at project root but this can be changed easily.
Explanation of services
Different Docker Compose services are organized to serve different needs.
train, the default service, should be used when compiled dependencies are necessary or when PyTorch needs to be compiled from source due to Compute Capability issues, etc.develis designed for PyTorch CUDA/C++ developers who need to recompile frequently and have many complex dependencies.ngcis derived from the official NVIDIA PyTorch NGC images with the option to install additional packages. It is recommended for users who wish to base their projects on the NGC images provided by NVIDIA. Note that the NGC images change between different releases and that configurations for one release may not work for another one.simpleis derived from the Official Ubuntu Linux image by default as some corporations restrict the use of Docker images not officially verified by Docker. It installs all packages viacondaby default and can optionally install highly reproducible environments viaconda-lock. Note thatpippackages can also be installed viaconda. Also, the base image can be configured to use images other than the Official Linux Docker images by specifying theBASE_IMAGEargument directly in the.envfile. PyTorch runtime performance may be superior in official NVIDIA CUDA images under certain circumstances. Use the tests to benchmark runtime speeds. Thesimpleservice is recommended for users without compiled dependencies.
The Makefile has been configured to take values specified in the .env file
if the .env file exists. Therefore, all make commands will automatically
use the ${SERVICE} specified by make env SERVICE=${SERVICE} after the
.env file is created.
Notes for Rootless Users
Many institutions forbid the use of Docker because it requires root permissions, compromising security.
For users without Docker root access, using rootless Docker
link is recommended.
While installing rootless Docker requires root permissions on the host, root permissions are not necessary after the initial installation.
When using rootless Docker, it is most convenient to set ADD_USER=exclude in the .env file
as the root user will be the host user in rootless Docker.
Project Configuration
-
To build PyTorch from source, set
BUILD_MODE=includeand the CUDA Compute Capability (CCC) of the target NVIDIA GPU in the.envfile. Visit the NVIDIA website to find compute capabilities of NVIDIA GPUs. Visit the documentation for an explanation of compute capability and its relevance. Note that the Docker cache will save previously built binaries if the given configurations are identical. -
Read the
docker-compose.yamlfile to fill in extra variables in.env. Also, feel free to editdocker-compose.yamlas necessary by changing session names, hostnames, etc. for different projects and configurations. Thedocker-compose.yamlfile provides reasonable default values but these can be overridden by values specified in the.envfile. An important configuration isipc: host, which allows the container to access the shared memory of the host. This is required for multiprocessing, e.g., to usenum_workersin the PyTorchDataLoaderclass. Disable this configuration on WSL and specifyshm_size:instead as WSL cannot use host IPC as of the time of writing. -
Edit requirements in
reqs/apt-train.requirements.txtandreqs/train-environment.yaml. These contain project package dependencies. Theaptrequirements are designed to resemble an ordinary Pythonrequirements.txtfile. -
Edit the
volumessection of a service to include external directories in the container environment. Runmake overto create adocker-compose.override.yamlfile to add custom volumes and configurations. Thedocker-compose.override.yamlfile is excluded from version control to allow per-user and per-server settings. -
(Advanced) If an external file must be included in the Docker image build process, edit the
.dockerignorefile to allow the Docker context to find the external file. By default, all files except requirements files are excluded from the Docker build context.
Example .env file for user with username USERNAME,
group name GROUPNAME, user id 1000, group id 1000 on service train.
Use the simple service if no dependencies need to be compiled and requirements
can either be downloaded or installed via apt, conda, or pip.
# Generated automatically by `make env`.
# When using the `root` user with `UID=0`/`USR=root`, set `ADD_USER=exclude`.
GID=1000
UID=1000
GRP=GROUPNAME
USR=USERNAME
HOST_ROOT=.
SERVICE=train
# Do not use the same `PROJECT` name for different projects on the same host!
PROJECT=train-username
Related Skills
node-connect
348.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
prose
348.2kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
claude-opus-4-5-migration
108.9kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
108.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

