Giter Club home page Giter Club logo

stable-diffusion-rocm-docker's Introduction

Stable Diffusion ROCm (Radeon OpenCompute) Dockerfile

Go from docker pull; docker run; txt2img on a Radeon โœจ.

Provides a Dockerfile that packages the AUTOMATIC1111 fork Stable Diffusion WebUI repository, preconfigured with dependencies to run on AMD Radeon GPUs (particularly 5xxx/6xxx desktop-class GPUs) via AMD's ROCm platform.

screenshot of a Void Linux/AMD GPU machine using the Stable Diffusion WebUI

Requirements

  • A compatible Radeon card (VEGA 56/64, Radeon RX 67XX/68XX/69XX). Other cards may also function at some capacity.
  • Modern Linux kernel with ROCM module (Kernel 5.10+)
  • Docker

Usage

First, pull the Docker image locally:

    docker pull l1naforever/stable-diffusion-rocm:latest

Now, create an alias which will be used to run the Docker container. This normally goes in your ~/.zshrc or ~/.bashrc:

    alias drun='docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $(pwd):/pwd'

Finally, run the container:

    drun --name stable-diffusion l1naforever/stable-diffusion-rocm:latest

After a period of downloading models and dependencies, you should see the output printed:

    Running on local URL:  http://localhost:7860/

Visit this URL in a browser to access the web UI.

Troubleshooting

Container fails to start with hipErrorNoBinaryForGpu: Unable to find code object for all current devices!

See issue #1. HIP's libraries bundled with the docker image are failing to load the right kernel for the specific GPU being used (this is particularly true with RX6xxx mobile variants). Try setting an environment variable to force HIP to use the gfx1030 kernel by passing the parameter -e HSA_OVERRIDE_GFX_VERSION=10.3.0 to docker run, or updating the above drun alias. For example:

    alias drun='docker run -e HSA_OVERRIDE_GFX_VERSION=10.3.0 -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $(pwd):/pwd'

stable-diffusion-rocm-docker's People

Contributors

l1na-forever avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.