Hello,

I’ve been having trouble getting Stable Diffusion to run on Arch. I bought a 7900 XTX a couple weeks ago to get away from NVIDIA, one thing I really liked to do was mess around in Stable Diffusion, but for some reason I can’t seem to get it working. I followed the guide on their page, but I think it may be outdated:

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs#install-on-amd-and-arch-linux

When I do ‘pip install -r requirements.txt’, it fails halfway through installing:

https://paste.debian.net/1317412

Not sure what to do from here, any help is appreciated!

  • Mechanize@feddit.it
    link
    fedilink
    arrow-up
    19
    ·
    6 months ago

    It’s an error with a dependency written in Rust, the workaround is to use an older toolchain (1.72), it is fixed in the newer code of tokenizers, but probably it is not updated in AUTOMATIC1111 yet: you should check their bug tracker

    To have more info you can read this issue: Link

  • pavunkissa@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    11
    ·
    6 months ago

    The problem, I believe, is that stable diffusion presently only supports Python 3.10, but Arch ships 3.12, and some of the dependencies aren’t compatible with the newer version. Here’s what I did to get it working on Arch + AMD 7800XT GPU.

    1. Install python310 package from AUR
    2. Manually create the virtualenv for stable diffusion with python3.10 -m venv venv (in stable diffusion root directory)

    This should be enough for the dependencies to install correctly. To get GPU acceleration to work, I also had to add this environment variable: HSA_OVERRIDE_GFX_VERSION=11.0.0 (Not sure if this is needed or if the value is same for 7900 XTX)

    • vaionko@sopuli.xyz
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      6 months ago

      I had python problems on Fedora and Nvidia. In addition to installing python 3.10, I needed to change the python command in webui.sh from python to python3.10

      • ffhein@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        6 months ago

        Perhaps you weren’t using venv? If you do, it ought to create aliases to both python and python3 to the correct binary

  • LittleBobbyTables@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    6 months ago

    I would try what the other commenter here said first. If that doesn’t fix your issue, I would try using the Forge version of WebUI (a fork of that WebUI with various memory optimizations, native extensions and other features): https://github.com/lllyasviel/stable-diffusion-webui-forge. This is what I personally use.

    I use a 6000-series GPU instead of a 7000-series one, so the setup may be slightly different for you, but I’ll walk you through what I did for my Arch setup.

    Me personally, I skipped that Wiki section on AMD GPUs entirely and it seems the WebUI still respects and utilizes my GPU just fine. Simply running the webui.sh file will do most of the heavy lifting for you (you can see in the webui.sh file that it uses specific configurations and ROCm versions for different AMD GPU series like Navi 2 and 3)

    1. Git clone that repo, git clone https://github.com/lllyasviel/stable-diffusion-webui-forge stable-diffusion-webui (the stable-diffusion-webui directory name is important, webui.sh’s script seems to reference that directory name specifically)
    2. From my experience it seems webui.sh and webui-user.sh are in the wrong spot, make symlinks to them so the symlinks are at the same level as the stable-diffusion-webui directory you created: ln stable-diffusion-webui/webui.sh webui.sh (ditto for webui-user.sh)
    3. Edit the webui-user.sh file. You don’t really have to change much in here, but I would recommend export COMMANDLINE_ARGS="--theme dark" if you want to save your eyes from burning.
    4. Here’s where things get a bit tricky: You will have to install Python 3.10, there is warnings that newer versions of Python will not work. I tried running the script with Python 3.12 and it failed trying to grab specific pip dependencies. I use the AUR for this; use yay -S python310 or paru -S python310 or whatever method you use to install packages from the AUR. Once you do that, edit webui-user.sh so that python_cmd looks like this: python_cmd="python3.10"
    5. Run the webui.sh file: chmod u+x webui.sh, then ./webui.sh
    6. Setup will take a while, it has to download and install all dependencies (including a model checkpoint, which is multiple gigabytes in size). If you notice it errors out at some points, try deleting the entire venv directory from within the stable-diffusion-webui directory and running the script again. This actually worked in my case, not really sure what went wrong…
    7. After a while, the webUI will launch. If it doesn’t automatically open your browser, then you can check the console for the URL, it’s usually http://127.0.0.1:7860. Select the proper checkpoint in the top left, write down a test prompt and hopefully it should be pretty speedy, considering your GPU.
  • Presi300@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    6 months ago

    To use AMDs machine learning thing (ROCm/HIP) you 1st need to set it up on your system, as it’s not a part of the FOSS driver. Tl:Dr don’t bother. AMD provides docker containers with ROCm/HIP already setup. Download one of those and install whatever you need on that. Trust me, you’re gonna save yourself a lot of nightmares.

    E: See: This for more information

  • exocortex@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    6 months ago

    I have no idea how to fix the problem, but I’ve read somewhere that burn (a relatively new machine learning framework in Rust) is capable of loading models like stable diffusion. As Burn is built with webGPU and all the shader transpiler-stuff that comes with it doesn’t that mean that it can also run easily on (even older) AMD cards? I think what’s lacking is equal performance as nvidia drivers are heavily optimized already.

    Maybe someone knows more here?