nod-ai / SHARK

SHARK - High Performance Machine Learning Distribution
Apache License 2.0
1.41k stars 168 forks source link

always black images with RX5700 - all stable and preview versions #1308

Open Skalt18 opened 1 year ago

Skalt18 commented 1 year ago

I'm always get black images. All Filters, img2img and txt2img many warning outputs System is Win11 and stock RX5700

image

image

one-lithe-rune commented 1 year ago

I need to set the AMD_ENABLE_LLPC environment variable to 1 avoid getting black images (this is with the .648 .exe version and a Radeon VII).

In powershell: $env:AMD_ENABLE_LLPC=1 then .\shark_sd_20230329_648.exe or however you start your version of the SHARK webui.

Skalt18 commented 1 year ago

That doesn´t work for me.

Edit: Even the CPU version only get a error output.

First is with vulkan, second try via CPU: PS C:\WINDOWS\system32> $env:AMD_ENABLE_LLPC=1 PS C:\WINDOWS\system32> D:\Entwicklung\SharkStableDiffusion\shark_sd_20230419_693.exe shark_tank local cache is located at C:\Users\Peter.local/shark_tank/ . You may change this by setting the --local_tank_cache= flag vulkan devices are available. cuda devices are not available. diffusers\models\cross_attention.py:30: FutureWarning: Importing from cross_attention is deprecated. Please import from diffusers.models.attention_processor instead. Running on local URL: http://0.0.0.0:8080

To create a public link, set share=True in launch(). Found device AMD Radeon RX 5700. Using target triple rdna2-unknown-windows. Using tuned models for Linaqruf/anything-v3.0/fp16/vulkan://00000000-2f00-0000-0000-000000000000. No vmfb found. Compiling and saving to C:\WINDOWS\system32\euler_scale_model_input_1_512_512fp16.vmfb Using target triple -iree-vulkan-target-triple=rdna2-unknown-windows from command line args Saved vmfb in C:\WINDOWS\system32\euler_scale_model_input_1_512_512fp16.vmfb. WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_VERBOSE does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_DEBUG does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. No vmfb found. Compiling and saving to C:\WINDOWS\system32\euler_step_1_512_512fp16.vmfb Using target triple -iree-vulkan-target-triple=rdna2-unknown-windows from command line args Saved vmfb in C:\WINDOWS\system32\euler_step_1_512_512fp16.vmfb. WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_VERBOSE does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_DEBUG does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. use_tuned? sharkify: True _1_77_512_512_fp16_tuned_anything-v3 No vmfb found. Compiling and saving to C:\WINDOWS\system32\clip_1_77_512_512_fp16_tuned_anything-v3_vulkan.vmfb Using target triple -iree-vulkan-target-triple=rdna2-unknown-windows from command line args Saved vmfb in C:\WINDOWS\system32\clip_1_77_512_512_fp16_tuned_anything-v3_vulkan.vmfb. WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_VERBOSE does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_DEBUG does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. mat1 and mat2 shapes cannot be multiplied (154x1024 and 768x320) Retrying with a different base model configuration Loading Winograd config file from C:\Users\Peter.local/shark_tank/configs\unet_winograd_vulkan.json 100%|███████████████████████████████████████████████████████████████████████████████████| 107/107 [00:00<00:00, 777B/s] 100%|█████████████████████████████████████████████████████████████████████████████████| 107/107 [00:00<00:00, 7.64kB/s] ERROR:asyncio:Exception in callback _ProactorBasePipeTransport._call_connection_lost(None) handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)> Traceback (most recent call last): File "asyncio\events.py", line 80, in _run File "asyncio\proactor_events.py", line 165, in _call_connection_lost ConnectionResetError: [WinError 10054] Eine vorhandene Verbindung wurde vom Remotehost geschlossen Loading lowering config file from C:\Users\Peter.local/shark_tank/configs\unet_v1_4_fp16_vulkan_rdna2.json 100%|██████████████████████████████████████████████████████████████████████████████| 24.6k/24.6k [00:00<00:00, 163kB/s] 100%|██████████████████████████████████████████████████████████████████████████████| 24.6k/24.6k [00:00<00:00, 174kB/s] Applying tuned configs on unet_1_77_512_512_fp16_tuned_anything-v3_vulkan No vmfb found. Compiling and saving to C:\WINDOWS\system32\unet_1_77_512_512_fp16_tuned_anything-v3_vulkan.vmfb Using target triple -iree-vulkan-target-triple=rdna2-unknown-windows from command line args Saved vmfb in C:\WINDOWS\system32\unet_1_77_512_512_fp16_tuned_anything-v3_vulkan.vmfb. WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_VERBOSE does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_DEBUG does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. 50it [00:21, 2.34it/s] torch\fx\node.py:251: UserWarning: Trying to prepend a node to itself. This behavior has no effect on the graph. warnings.warn("Trying to prepend a node to itself. This behavior has no effect on the graph.") No vmfb found. Compiling and saving to C:\WINDOWS\system32\vae_1_77_512_512_fp16_tuned_anything-v3_vulkan.vmfb Using target triple -iree-vulkan-target-triple=rdna2-unknown-windows from command line args Saved vmfb in C:\WINDOWS\system32\vae_1_77_512_512_fp16_tuned_anything-v3_vulkan.vmfb. WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_VERBOSE does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : Layer name GalaxyOverlayVkLayer_DEBUG does not conform to naming standard (Policy #LLP_LAYER_3) WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Tuned models are currently not supported for this setting. failed to download model, falling back and using import_mlir loading existing vmfb from: C:\WINDOWS\system32\euler_scale_model_input_1_512_512fp16.vmfb loading existing vmfb from: C:\WINDOWS\system32\euler_step_1_512_512fp16.vmfb use_tuned? sharkify: False _1_77_512_512_fp16_anything-v3 No vmfb found. Compiling and saving to C:\WINDOWS\system32\clip_1_77_512_512_fp16_anything-v3_cpu.vmfb Target triple found:x86_64-pc-windows-msvc Saved vmfb in C:\WINDOWS\system32\clip_1_77_512_512_fp16_anything-v3_cpu.vmfb. No vmfb found. Compiling and saving to C:\WINDOWS\system32\unet_1_77_512_512_fp16_anything-v3_cpu.vmfb Target triple found:x86_64-pc-windows-msvc Traceback (most recent call last): File "gradio\routes.py", line 401, in run_predict File "gradio\blocks.py", line 1302, in process_api File "gradio\blocks.py", line 1039, in call_function File "anyio\to_thread.py", line 31, in run_sync File "anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread File "anyio_backends_asyncio.py", line 867, in run File "gradio\utils.py", line 491, in async_iteration File "ui\txt2img_ui.py", line 173, in txt2img_inf File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 122, in generate_images File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 203, in produce_img_latents File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 103, in load_unet File "apps\stable_diffusion\src\models\model_wrappers.py", line 640, in unet File "apps\stable_diffusion\src\models\model_wrappers.py", line 611, in unet File "apps\stable_diffusion\src\models\model_wrappers.py", line 575, in compile_unet_variants File "apps\stable_diffusion\src\models\model_wrappers.py", line 450, in get_unet File "apps\stable_diffusion\src\utils\utils.py", line 157, in compile_through_fx File "apps\stable_diffusion\src\utils\utils.py", line 66, in _compile_module File "shark\shark_inference.py", line 188, in save_module File "shark\iree_utils\compile_utils.py", line 346, in export_iree_module_to_vmfb File "shark\iree_utils\compile_utils.py", line 274, in compile_module_to_flatbuffer File "iree\compiler\tools\core.py", line 280, in compile_str File "iree\compiler\tools\binaries.py", line 196, in invoke_immediate SystemExit: Error invoking IREE compiler tool iree-compile.exe Diagnostics: iree-lld: error: undefined symbol: fmaxf

referenced by .29:187 C:\Users\Peter\AppData\Local\Temp\llvm_module_linked_llvm_cpu-24007b.o:(forward_dispatch_49_softmax_2x8x4096x4096xf16) referenced by .29:187 C:\Users\Peter\AppData\Local\Temp\llvm_module_linked_llvm_cpu-24007b.o:(forward_dispatch_49_softmax_2x8x4096x4096xf16) referenced by .29:187 C:\Users\Peter\AppData\Local\Temp\llvm_module_linked_llvm_cpu-24007b.o:(forward_dispatch_49_softmax_2x8x4096x4096xf16) referenced 477 more times did you mean: fmaf defined in: C:\Users\Peter\AppData\Local\Temp\llvm_module_linked_llvm_cpu-24007b.o Linking failed; escaped command line returned exit code 1:

set LLD_VERSION=IREE && C:\Users\Peter\AppData\Local\Temp_MEI29322\iree\compiler\tools.._mlir_libs\iree-lld.exe -flavor gnu -o C:\Users\Peter\AppData\Local\Temp\llvm_module_linked_llvm_cpu-24007b.so --build-id=none -nostdlib -static -shared --no-undefined --no-allow-shlib-undefined --allow-multiple-definition --gc-sections -z now -z relro --discard-all --icf=all --ignore-data-address-equality --ignore-function-address-equality --hash-style=sysv C:\Users\Peter\AppData\Local\Temp\llvm_module_linked_llvm_cpu-24007b.o

:0: error: failed to link executable and generate target dylib (check above for more specific error messages) :0: error: failed to serialize executable for target backend llvm-cpu :0: error: failed to serialize executables Invoked with: iree-compile.exe C:\Users\Peter\AppData\Local\Temp\_MEI29322\iree\compiler\tools\..\_mlir_libs\iree-compile.exe - --iree-input-type=tm_tensor --iree-vm-bytecode-module-output-format=flatbuffer-binary --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-embedded-linker-path=C:\Users\Peter\AppData\Local\Temp\_MEI29322\iree\compiler\tools\..\_mlir_libs\iree-lld.exe --mlir-print-debuginfo --mlir-print-op-on-diagnostic=false --iree-llvmcpu-target-cpu-features=host --iree-llvmcpu-target-triple=x86_64-pc-windows-msvc --iree-stream-resource-index-bits=64 --iree-vm-target-index-bits=64 --iree-vm-bytecode-module-strip-source-map=true --iree-util-zero-fill-elided-attrs --iree-preprocessing-pass-pipeline=builtin.module(func.func(iree-flow-detach-elementwise-from-named-ops,iree-flow-convert-1x1-filter-conv2d-to-matmul,iree-preprocessing-convert-conv2d-to-img2col,iree-preprocessing-pad-linalg-ops{pad-size=32})) Need more information? Set IREE_SAVE_TEMPS=/some/dir in your environment to save all artifacts and reproducers.