Skip to content

Vulkan on AMD Ryzen AI APU/iGPU generates worse images than CPU, or just colorful noise #563

Description

@lostdisc

When I run stable-diffusion.cpp with Vulkan on a Ryzen AI 9 HX 370 (Radeon 890M iGPU), the resulting images are very different from what I get when running on CPU with the AVX2 build. Some comparison pics follow.

SDXL

For reference, the below pic is what I get from SDXL on my CPU if I prompt as follows:
sd -m sd_xl_base_1.0.safetensors --vae sdxl.vae.safetensors -H 1024 -W 1024 -p "a lovely cat"
(Note that I needed to use madebyollin's fp16 vae to get an output that isn't all black.)
sd-cpp-avx2_vae-fp16_cat_1024x1024_output

And below is what I get from SDXL on my GPU using Vulkan:
sd -m sd_xl_base_1.0.safetensors --vae sdxl.vae.safetensors --vae-on-cpu -H 1024 -W 1024 -p "a lovely cat"
(Note that running VAE on the CPU versus tiled on the GPU produces essentially the same-looking image below. Attempting to run on GPU without tiling fails when it requests an excessive amount of memory, as described in stduhpf's comment here.)
sd-cpp-vulkan_vae-fp16-on-cpu_cat_1024x1024_output

SD 1.5

With SD 1.5, Vulkan at least produces actual cat pictures, but they are blurry or deformed compared to CPU.

For reference, below is what I get from the CPU for the following prompt:
sd -m v1-5-pruned-emaonly.safetensors -p "a lovely cat"
sd-cpp-avx2_cat_output

And below is what I get from the GPU with Vulkan:
sd -m v1-5-pruned-emaonly.safetensors -p "a lovely cat"
(I also tried running this with the VAE on the CPU, but it gives the same cat below with no apparent visual difference.)
sd-cpp-vulkan_cat_output

Finally, running clip on the CPU gives a different, more-deformed cat:
sd -m v1-5-pruned-emaonly.safetensors --vae-on-cpu --clip-on-cpu -p "a lovely cat"
sd-cpp-vulkan_vae+clip-on-cpu_cat_output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions