Join WhatsApp
Join Now
Join Telegram
Join Now

Linux for AI/ML: Running Stable Diffusion with an AMD GPU on Linux

Avatar for Noman Mohammad

By Noman Mohammad

Published on:

Your rating ?

Hey, fellow tinkerer. Grab your coffee—let’s make that AMD-GPU + Linux combo sing

I spent last winter hunched over the same problem you’re facing right now: a fresh Linux install, a shiny RX 7800 XT, and zero idea why Stable Diffusion kept laughing in my face.

The guides I found were from **2019**. They told me to “just use Docker” or “give up and buy NVIDIA.” Both answers felt like a kick in the ribs.

Fast-forward to August 2025. ROCm 6.1 is out. ComfyUI runs on my card like butter. I finally get to **choose** my hardware instead of begging it to work.

In the next ten minutes, we’ll copy-paste the exact steps that took me from “error spam” to “prompt-engineering at 30 steps in two seconds.”

The 2025 problem (spoiler: it’s not AMD anymore)

Older posts still frame AMD cards as the “backup choice.” That was fair two years ago.

Now? I’m seeing Reddit threads where hobbyists brag about spending **$320** on a used RX 6700 XT that beats an RTX 3060 in raw AI speed. ROCm’s Github gained **7k fresh commits** this year. Even the official docs have live examples in plain English.

Real talk: yesterday’s headache is today’s three-line install. No more hand-waving, no more forum scavenger hunts.

Will my card even show up?

Ryzen A-line APUs still **don’t** count. Grab a desktop RX **6000** or **7000** card and you’re golden.

Quick sanity check:

  • Pop open a terminal.
  • Type “`rocm-smi“`.
  • If you see VRAM numbers, we’re already 35 % there.

(My 7900 XTX shows “VRAM 24512 MiB” right now, which made me giggle like a little kid.)

The five-copy-paste routine

1. My go-to OS: Ubuntu 22.04 LTS

Why not Arch? Because I want to generate images, not fix “`pacman -S“` loops two hours from now. Ubuntu’s default kernel plays nice with ROCm, period.

2. Put ROCm on the system

sudo apt update
sudo apt install rocm-dkms
sudo reboot

Yes, reboot. Linux will thank you with a cooler GPU later.

3. Make a sandbox

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
conda create -n sdxl python=3.10 -y
conda activate sdxl

4. Fetch the **right** PyTorch

Everyone stumbles here. Copy the **exact** ROCm line from Pytorch’s “Get Started” page. Mine looks like:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0

Run **this** test immediately:

python -c "import torch; print(torch.cuda.is_available())"

Seeing “`True“` feels like winning the lottery with a scratch-off ticket.

5. Install Fooocus (or whichever UI makes you smile)

git clone https://github.com/lllyasviel/Fooocus.git
cd Fooocus
pip install -r requirements_versions.txt

One last magic word

You brand-new 6xxxx card? Speak its dialect:

HSA_OVERRIDE_GFX_VERSION=10.3.0 python entry_with_update.py --preset realistic

Got a 7900/7800/7700? Swap to:

HSA_OVERRIDE_GFX_VERSION=11.0.0 python entry_with_update.py --preset anime

Open http://127.0.0.1:7865 and watch the fan curve climb. That’s the sound of moving pixels, not cruise missiles.

My personal checklist for “first-run nervousness”

  • Is the prompt longer than your coffee order? Good. Mine starts with “cinematic soft neon portrait…”
  • Create the **inpaint** tab next—one stray thumb can ruin the entire hand.
  • Drop a new SafeTensor model into “`models/checkpoints/“`, refresh the UI, hit **Generate**. If you hear coil whine rise an octave, congrats, the GPU is *happy*.

Still banging your head? Three final band-aids

1. Wrong Python version?
“`conda list python“` should say 3.10.x. Anything else is grumpy old code.

2. Distro upgrade broke ROCm?
Pin the compiled file:

sudo apt-mark hold rocm-dkms

3. Fooocus crashes on launch?
Grab the fresh repo daily. I do this every Friday to stay on the happy path.

That’s it—no caveats, no fine print

You now have an AMD-first, Linux-native pipeline that turns words into 1024-pixel daydreams. Copy the steps. Share the link. And once your first perfect cat pirate portrait drops, tag me—I’ll upvote it while I tweak a new LoRA.

Ready? Open that terminal. I’ll race you to the title card.

Leave a Comment