kohya_ss/docs/installation_docker.md

3.1 KiB

Docker

Get your Docker ready for GPU support

Windows

Once you have installed Docker Desktop, CUDA Toolkit, NVIDIA Windows Driver, and ensured that your Docker is running with WSL2, you are ready to go.

Here is the official documentation for further reference.
https://docs.nvidia.com/cuda/wsl-user-guide/index.html#nvidia-compute-software-support-on-wsl-2 https://docs.docker.com/desktop/wsl/use-wsl/#gpu-support

Linux, OSX

Install an NVIDIA GPU Driver if you do not already have one installed.
https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html

Install the NVIDIA Container Toolkit with this guide.
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

Design of our Dockerfile

  • It is required that all training data is stored in the dataset subdirectory, which is mounted into the container at /dataset.
  • Please note that the file picker functionality is not available. Instead, you will need to manually input the folder path and configuration file path.
  • TensorBoard has been separated from the project.
    • TensorBoard is not included in the Docker image.
    • The "Start TensorBoard" button has been hidden.
    • TensorBoard is launched from a distinct container as shown here.
  • The browser won't be launched automatically. You will need to manually open the browser and navigate to http://localhost:7860/ and http://localhost:6006/
  • This Dockerfile has been designed to be easily disposable. You can discard the container at any time and restart it with the new code version.

Use the pre-built Docker image

git clone --recursive https://github.com/bmaltais/kohya_ss.git
cd kohya_ss
docker compose up -d

To update the system, do docker compose down && docker compose up -d --pull always

Local docker build

[!IMPORTANT]
Clone the Git repository recursively to include submodules:
git clone --recursive https://github.com/bmaltais/kohya_ss.git

git clone --recursive https://github.com/bmaltais/kohya_ss.git
cd kohya_ss
docker compose up -d --build

[!NOTE]
Building the image may take up to 20 minutes to complete.

To update the system, checkout to the new code version and rebuild using docker compose down && docker compose up -d --build --pull always

[!NOTE] If you are running on Linux, an alternative Docker container port with fewer limitations is available here.

ashleykleynhans runpod docker builds

You may want to use the following repositories when running on runpod: