There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Anyone have experience with StableDiffusion on Linux with AMD and NVIDIA?

Should I struggle through constant crashes to get my 7900gre with 16gb of vram working, possibly through the headache of ONNX? Can anyone report their own success or offer advice? AMD on linux is generally lovely, SD with AMD on linux, not so much. It was much better with my RTX2080 on linux but gaming was horrible with NVIDIA drivers. I feel I could do more with the 16GB AMD card if stability wasn’t so bad. I currently have both cards running to the horror of my PSU. A1111 does NOT want to see the NVIDIA card, only the AMD. Something about the version of pytorch? More work to be done there.

electricprism ,

Docker seemed the easiest

abcdqfr OP ,

I might take the docker route for the ease of troubleshooting if nothing else. So very sick of hard system freezes/crashes while kludging through the troubleshooting process. Any words of wisdom?

electricprism ,

Assume I’m an amature and bad at this ;P

In any case you might try a docker-compose.yml


<span style="color:#323232;">version: "3.8"
</span><span style="color:#323232;"># Compose file build variables set in .env
</span><span style="color:#323232;">services:
</span><span style="color:#323232;">  supervisor:
</span><span style="color:#323232;">    platform: linux/amd64
</span><span style="color:#323232;">    build:
</span><span style="color:#323232;">      context: ./build
</span><span style="color:#323232;">      args:
</span><span style="color:#323232;">        PYTHON_VERSION: ${PYTHON_VERSION:-3.10}
</span><span style="color:#323232;">        PYTORCH_VERSION: ${PYTORCH_VERSION:-2.2.2}
</span><span style="color:#323232;">        WEBUI_TAG: ${WEBUI_TAG:-}
</span><span style="color:#323232;">        IMAGE_BASE: ${IMAGE_BASE:-ghcr.io/ai-dock/python:${PYTHON_VERSION:-3.10}-cuda-11.8.0-base-22.04}
</span><span style="color:#323232;">      tags:
</span><span style="color:#323232;">        - "ghcr.io/ai-dock/stable-diffusion-webui:${IMAGE_TAG:-cuda-11.8.0-base-22.04}"
</span><span style="color:#323232;">        
</span><span style="color:#323232;">    image: ghcr.io/ai-dock/stable-diffusion-webui:${IMAGE_TAG:-cuda-11.8.0-base-22.04}
</span><span style="color:#323232;">    
</span><span style="color:#323232;">    devices:
</span><span style="color:#323232;">      - "/dev/dri:/dev/dri"
</span><span style="color:#323232;">      # For AMD GPU
</span><span style="color:#323232;">      #- "/dev/kfd:/dev/kfd"
</span><span style="color:#323232;">    
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      # Workspace
</span><span style="color:#323232;">      - ./workspace:${WORKSPACE:-/workspace/}:rshared
</span><span style="color:#323232;">      # You can share /workspace/storage with other non-WEBUI containers. See README
</span><span style="color:#323232;">      #- /path/to/common_storage:${WORKSPACE:-/workspace/}storage/:rshared
</span><span style="color:#323232;">      # Will echo to root-owned authorized_keys file;
</span><span style="color:#323232;">      # Avoids changing local file owner
</span><span style="color:#323232;">      - ./config/authorized_keys:/root/.ssh/authorized_keys_mount
</span><span style="color:#323232;">      - ./config/provisioning/default.sh:/opt/ai-dock/bin/provisioning.sh
</span><span style="color:#323232;">    
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">        # SSH available on host machine port 2222 to avoid conflict. Change to suit
</span><span style="color:#323232;">        - ${SSH_PORT_HOST:-2222}:${SSH_PORT_LOCAL:-22}
</span><span style="color:#323232;">        # Caddy port for service portal
</span><span style="color:#323232;">        - ${SERVICEPORTAL_PORT_HOST:-1111}:${SERVICEPORTAL_PORT_HOST:-1111}
</span><span style="color:#323232;">        # WEBUI web interface
</span><span style="color:#323232;">        - ${WEBUI_PORT_HOST:-7860}:${WEBUI_PORT_HOST:-7860}
</span><span style="color:#323232;">        # Jupyter server
</span><span style="color:#323232;">        - ${JUPYTER_PORT_HOST:-8888}:${JUPYTER_PORT_HOST:-8888}
</span><span style="color:#323232;">        # Syncthing
</span><span style="color:#323232;">        - ${SYNCTHING_UI_PORT_HOST:-8384}:${SYNCTHING_UI_PORT_HOST:-8384}
</span><span style="color:#323232;">        - ${SYNCTHING_TRANSPORT_PORT_HOST:-22999}:${SYNCTHING_TRANSPORT_PORT_HOST:-22999}
</span><span style="color:#323232;">   
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">        # Don't enclose values in quotes
</span><span style="color:#323232;">        - DIRECT_ADDRESS=${DIRECT_ADDRESS:-127.0.0.1}
</span><span style="color:#323232;">        - DIRECT_ADDRESS_GET_WAN=${DIRECT_ADDRESS_GET_WAN:-false}
</span><span style="color:#323232;">        - WORKSPACE=${WORKSPACE:-/workspace}
</span><span style="color:#323232;">        - WORKSPACE_SYNC=${WORKSPACE_SYNC:-false}
</span><span style="color:#323232;">        - CF_TUNNEL_TOKEN=${CF_TUNNEL_TOKEN:-}
</span><span style="color:#323232;">        - CF_QUICK_TUNNELS=${CF_QUICK_TUNNELS:-true}
</span><span style="color:#323232;">        - WEB_ENABLE_AUTH=${WEB_ENABLE_AUTH:-true}
</span><span style="color:#323232;">        - WEB_USER=${WEB_USER:-user}
</span><span style="color:#323232;">        - WEB_PASSWORD=${WEB_PASSWORD:-password}
</span><span style="color:#323232;">        - SSH_PORT_HOST=${SSH_PORT_HOST:-2222}
</span><span style="color:#323232;">        - SSH_PORT_LOCAL=${SSH_PORT_LOCAL:-22}
</span><span style="color:#323232;">        - SERVICEPORTAL_PORT_HOST=${SERVICEPORTAL_PORT_HOST:-1111}
</span><span style="color:#323232;">        - SERVICEPORTAL_METRICS_PORT=${SERVICEPORTAL_METRICS_PORT:-21111}
</span><span style="color:#323232;">        - SERVICEPORTAL_URL=${SERVICEPORTAL_URL:-}
</span><span style="color:#323232;">        - WEBUI_BRANCH=${WEBUI_BRANCH:-}
</span><span style="color:#323232;">        - WEBUI_FLAGS=${WEBUI_FLAGS:-}
</span><span style="color:#323232;">        - WEBUI_PORT_HOST=${WEBUI_PORT_HOST:-7860}
</span><span style="color:#323232;">        - WEBUI_PORT_LOCAL=${WEBUI_PORT_LOCAL:-17860}
</span><span style="color:#323232;">        - WEBUI_METRICS_PORT=${WEBUI_METRICS_PORT:-27860}
</span><span style="color:#323232;">        - WEBUI_URL=${WEBUI_URL:-}
</span><span style="color:#323232;">        - JUPYTER_PORT_HOST=${JUPYTER_PORT_HOST:-8888}
</span><span style="color:#323232;">        - JUPYTER_METRICS_PORT=${JUPYTER_METRICS_PORT:-28888}
</span><span style="color:#323232;">        - JUPYTER_URL=${JUPYTER_URL:-}
</span><span style="color:#323232;">        - SERVERLESS=${SERVERLESS:-false}
</span><span style="color:#323232;">        - SYNCTHING_UI_PORT_HOST=${SYNCTHING_UI_PORT_HOST:-8384}
</span><span style="color:#323232;">        - SYNCTHING_TRANSPORT_PORT_HOST=${SYNCTHING_TRANSPORT_PORT_HOST:-22999}
</span><span style="color:#323232;">        - SYNCTHING_URL=${SYNCTHING_URL:-}
</span><span style="color:#323232;">        #- PROVISIONING_SCRIPT=${PROVISIONING_SCRIPT:-}
</span>

install.sh


<span style="color:#323232;">sudo pacman -S docker
</span><span style="color:#323232;">sudo pacman -S docker-compose
</span>

update.sh


<span style="color:#323232;">#!/bin/bash
</span><span style="color:#323232;"># https://stackoverflow.com/questions/49316462/how-to-update-existing-images-with-docker-compose
</span><span style="color:#323232;">
</span><span style="color:#323232;">sudo docker-compose pull
</span><span style="color:#323232;">sudo docker-compose up --force-recreate --build -d
</span><span style="color:#323232;">sudo docker image prune -f
</span>

start.sh


<span style="color:#323232;">#!/bin/bash
</span><span style="color:#323232;">sudo docker-compose down --remove-orphans && sudo docker-compose up
</span>
toothbrush ,
@toothbrush@lemmy.blahaj.zone avatar

I have run Stable Diffusion models successfully with my ancient Vega 64 with 8 gb vram. However, it does occasionally run out of memory and crash when I run models that want all 8 gigs. I have to run it without a proper DE(openbox, falkon browser with one tab only) if I dont want it to crash frequently.

abcdqfr OP ,

How bad are your crashes? Mine will either freeze the system entirely or crash the current lightdm session, sometimes recovering, sometimes freezing anyway. Needs power cycle to rescue. What is the DE you speak of? openbox?

vikingtons ,
@vikingtons@lemmy.world avatar

the reset situation may improve in the not too distant future: www.phoronix.com/news/AMDGPU-Per-Ring-Resets

31337 ,

That seems strange. Perhaps you should stress-test your GPU/system to see if it’s a hardware problem.

abcdqfr OP ,

I had that concern as well with it being a new card. It performs fine in gaming as well as in every glmark benchmark so far. I have it chalked up to amd support being in experimenntal status on linux/SD. Any other stress tests you recommend while I’m in the return window!? lol

31337 ,

I’ve used this before: github.com/wilicc/gpu-burn?tab=readme-ov-file

Yeah, it may be a driver issue, Nvidia/pytorch handles OOM gracefully on my system.

abcdqfr OP ,

Well I finally got the nvidia card working to some extent. On the recommended driver it only works in lowvram. medvram maxes vram too easily on this driver/cuda version for whatever reason. Does anyone know the current best nvidia driver for sd on linux? Perhaps 470, the other provided by the LM driver manager…?

31337 ,

SD works fine for me with: Driver Version: 525.147.05 CUDA Version: 12.0

I use this docker container: github.com/…/stable-diffusion-webui-docker

You will also need to install the nvidia container toolkit if you use docker containers: docs.nvidia.com/datacenter/…/install-guide.html

abcdqfr OP ,

Thank you!! I may rely on this heavily. Too many different drivers to try willy-nilly. I am in the process of attempting with this guide/driver for now. Will report back with my luck or misfortunes hub.tcno.co/ai/…/automatic1111-fast/

version for whatever reason. Does anyone know the current best nvidia driver for

vintageballs ,

I’m on 550, never had any problems with using ComfyUI or sd-webui. Docker makes it easier to get out of dependency hell imo

j4k3 ,
@j4k3@lemmy.world avatar

There are likely automatic checks in the startup script. I don’t use A1111 any more in favor of Comfy and I only have a 3080Ti with 16 GB (mobile version). I can run within issues. The only time I have issues with anything AI related is when I need Nvidia’s proprietary compiler nvcc. I need nvcc to hack around with things like llama.cpp. With nvcc, it can have issues with the open source driver

just_another_person ,

If you don’t understand how models use host caching, start there.

Outside of that, you’re asking people to simplify everything into a quick answer, and there is none.

ONNX is the “universal” standard, ensure you didn’t accidentally convert the input model into something else by accident, but more importantly, ensure when you run it and automatically convert, that the works are actually done on the GPU. ONNX defaults to CPU.

abcdqfr OP ,

I started reading into the ONNX business here rocm.blogs.amd.com/…/README.htmlDidn’t take long to see that was beyond me. Has anyone distilled an easy to use model converter/conversion process? One I saw required a HF token for the process, yeesh

just_another_person ,

No.

As I said, you’re trying to distill people’s profession into an easy to digest guide about “make it work”. Nothin like that exists.

Same way you can’t just get a job doing “doctor stuff”, or “build junk”.

abcdqfr OP ,

Since only one of us is feeling helpful, here is a 6 minute video for the rest of us to enjoy www.youtube.com/watch?v=lRBsmnBE9ZA

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines