Skip to content

AMD GPU Segmentation fault in Line 53 #1915

@ZenonEl

Description

@ZenonEl

Describe the bug
Segmentation fault when starting the Server

To Reproduce
Steps to reproduce the behavior:

start easy-diffusion
./start.sh

Expected behavior
Easy-Diffusion should start and work.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: CachyOS (based on the Arch Linux)
  • Browser: Brave
  • Version: 1.76.74 Chromium: 134.0.6998.89

Hardware:
CPU: AMD Ryzen 5 3500X 6-Core Processor
RAM: 16GB
GPU: AMD Radeon RX 7600
VRAM: 8GB

Additional context
Add any other context about the problem here.

❯ ./start.sh
/usr/bin/curl
/usr/bin/tar
/usr/bin/bzip2
/usr/bin/git
git version 2.48.1
easy-diffusion/installer_files/env/bin/conda
conda 25.1.1


Easy Diffusion - v3

Easy Diffusion's git repository was already installed. Updating from main..
Нет локальных изменений для сохранения
Указатель HEAD сейчас на коммите 1b3d048b Use safetensors as the default model instead of ckpt
Уже на «main»
Эта ветка соответствует «origin/main».
Уже актуально.
easy-diffusion/installer_files/env/lib/python3.9/site-packages/conda/base/context.py:202: FutureWarning: Adding 'defaults' to channel list implicitly is deprecated and will be removed in 25.3.

To remove this warning, please choose a default channel explicitly with conda's regular configuration system, e.g. by adding 'defaults' to the list of channels:

  conda config --add channels defaults

For more information see https://docs.conda.io/projects/conda/en/stable/user-guide/configuration/use-condarc.html

  deprecated.topic(
torchruntime: 1.15.1
torch: 2.5.1+rocm6.2
torchvision: 0.20.1+rocm6.2
sdkit: 2.0.22.8
stable-diffusion-sdkit: 2.1.5
diffusers: 0.28.2
{}


Easy Diffusion installation complete, starting the server!


[INFO] Setting env variable HSA_OVERRIDE_GFX_VERSION=11.0.0
[INFO] Setting env variable HIP_VISIBLE_DEVICES=0
--- GPUs ---
0. GPU(vendor_id='1002', vendor_name='Advanced Micro Devices, Inc. [AMD/ATI]', device_id='7480', device_name='Navi 33 [Radeon RX 7600/7600 XT/7600M XT/7600S/7700S / PRO W7600]', is_discrete=True)

--- RECOMMENDED TORCH PLATFORM ---
rocm6.2

--- CONFIGURATION ---
[INFO] Setting env variable HSA_OVERRIDE_GFX_VERSION=11.0.0
[INFO] Setting env variable HIP_VISIBLE_DEVICES=0
PYTHONPATH=easy-diffusion/installer_files/env/lib/python3.8/site-packages
Python:  easy-diffusion/installer_files/env/bin/python
Version: 3.9.21

Launching uvicorn

08:52:22.159 INFO MainThread started in                                                      server.py:31
easy-diffusion/stable-diffusion
08:52:22.162 INFO MainThread started at 03/17/25 08:52:22                                    server.py:32
easy-diffusion/installer_files/env/lib/python3.9/site-packages/pydantic/_internal/_config.py:345: UserWarning: Valid config keys have changed in V2:
* 'orm_mode' has been renamed to 'from_attributes'
  warnings.warn(message, UserWarning)
stable-diffusion model(s) found.
gfpgan model(s) found.
realesrgan model(s) found.
vae model(s) found.
08:52:22.351 INFO MainThread Start new Rendering Thread on device: cuda               task_manager.py:410
08:52:22.354 INFO cuda Device usage during initialization:                                  runtime.py:35
08:52:22.355 INFO cuda CPU utilization: 0.0%, System RAM used: 5.5 of 15.5 GiB, GPU    memory_utils.py:58
RAM used (cuda:0): 0.1 of 8.0 GiB (peak: 0.0 GiB)
08:52:22.356 INFO cuda Setting cuda as active, with precision: half                 device_manager.py:123
easy-diffusion/installer_files/env/lib/python3.9/site-packages/transformers/utils/generic.py:311: FutureWarning: `torch.utils._pytree._register_pytree_node` is deprecated. Please use `torch.utils._pytree.register_pytree_node` instead.
  torch.utils._pytree._register_pytree_node(
easy-diffusion/installer_files/env/lib/python3.9/site-packages/transformers/utils/generic.py:311: FutureWarning: `torch.utils._pytree._register_pytree_node` is deprecated. Please use `torch.utils._pytree.register_pytree_node` instead.
  torch.utils._pytree._register_pytree_node(
08:52:22.480 INFO cuda loading stable-diffusion model from                                 __init__.py:52
easy-diffusion/models/stable-diffusion/sd-v1-5.safetensors
to device: cuda
No module 'xformers'. Proceeding without it.
easy-diffusion/installer_files/env/lib/python3.9/site-packages/diffusers/models/transformers/transformer_2d.py:34: FutureWarning: `Transformer2DModelOutput` is deprecated and will be removed in version 1.0.0. Importing `Transformer2DModelOutput` from `diffusers.models.transformer_2d` is deprecated and this will be removed in a future version. Please use `from diffusers.models.modeling_outputs import Transformer2DModelOutput`, instead.
  deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)
08:52:23.436 INFO MainThread Opening browser..                                                 app.py:317
08:52:23.464 INFO cuda loading on diffusers                                               __init__.py:168
08:52:23.465 INFO cuda using config:                                                      __init__.py:170
easy-diffusion/installer_files/env/lib/python3.9/site-packa
ges/sdkit/models/models_db/configs/v1-inference.yaml
08:52:23.477 INFO cuda using attn_precision: fp16                                         __init__.py:186
╭─────────────────────────────────────── Easy Diffusion is ready ───────────────────────────────────────╮
│                                                                                                       │
│ Easy Diffusion is ready to serve requests.                                                            │
│                                                                                                       │
│ A new browser tab should have been opened by now.                                                     │
│ If not, please open your web browser and navigate to http://localhost:9000/                           │
│                                                                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯
2025-03-17T08:52:23.582980386+04:00  INFO browsers: Starting Browsers
2025-03-17T08:52:23.583001806+04:00  INFO browsers: Logging to .local/state/software.Browsers/logs/browsers.log
2025-03-17T08:52:23.583025942+04:00  INFO browsers::communicate: No other instance of Browsers was running
2025-03-17T08:52:23.583029338+04:00  INFO browsers::communicate: Cleaning up previous local socket file
2025-03-17T08:52:23.583052973+04:00  INFO browsers::communicate: Started socket listener for new instances of Browser
2025-03-17T08:52:23.583122755+04:00  INFO basically_main: browsers::browser_repository: Repository: /usr/share/software.Browsers/resources/repository/application-repository.toml
2025-03-17T08:52:23.628621346+04:00  INFO basically_main: browsers::linux::linux_utils: Default for x-scheme-handler/https is 'software.Browsers.desktop'
2025-03-17T08:52:23.64838373+04:00  INFO basically_main: browsers::linux::linux_utils: Default for x-scheme-handler/http is 'software.Browsers.desktop'
2025-03-17T08:52:23.648425639+04:00  INFO basically_main: browsers::utils: Config: .config/software.Browsers/config.json
2025-03-17T08:52:23.648700158+04:00  INFO basically_main: browsers::utils: Config: .config/software.Browsers/config.json

(browsers:115649): GLib-GIO-CRITICAL **: 08:52:23.711: This application can not open files.
2025-03-17T08:52:25.712979261+04:00  INFO basically_main: browsers::gui::ui: Exiting Browsers
Окно или вкладка откроются в текущем сеансе браузера.
You have disabled the safety checker for <class 'diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline'> by passing `safety_checker=None`. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
easy-diffusion/scripts/on_sd_start.sh: строка 53: 115419 Ошибка сегментирования                   (образ памяти сброшен на диск) python scripts/check_modules.py --launch-uvicorn
Press any key to continue

~easy-diffusion 1m 39s
❯

I also tried this:
Run ./developer_console.sh
Run python -m pip show torch
Run torchruntime info
Run the torchruntime test

But also got a segmentation error when running torchruntime test

❯ ./developer_console.sh
Opening Stable Diffusion UI - Developer Console..

easy-diffusion/installer_files/env/lib/python3.9/site-packages/conda/base/context.py:202: FutureWarning: Adding 'defaults' to channel list implicitly is deprecated and will be removed in 25.3.

To remove this warning, please choose a default channel explicitly with conda's regular configuration system, e.g. by adding 'defaults' to the list of channels:

  conda config --add channels defaults

For more information see https://docs.conda.io/projects/conda/en/stable/user-guide/configuration/use-condarc.html

  deprecated.topic(
Environment Info:
/usr/bin/git
git version 2.48.1
easy-diffusion/installer_files/env/bin/conda
conda 25.1.1

easy-diffusion/installer_files/env/bin/python
Python 3.9.21
PYTHONPATH=easy-diffusion/installer_files/env/lib/python3.8/site-packages

(base) [xxx@cachyos-xxx easy-diffusion]$ python -m pip show torch
Name: torch
Version: 2.5.1+rocm6.2
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3-Clause
Location: easy-diffusion/installer_files/env/lib/python3.9/site-packages
Requires: filelock, fsspec, jinja2, networkx, pytorch-triton-rocm, sympy, typing-extensions
Required-by: accelerate, basicsr, clean-fid, clip-anytorch, compel, controlnet-aux, facexlib, gfpgan, invisible-watermark, k-diffusion, kornia, open-clip-torch, pytorch-lightning, realesrgan, test_tube, timm, torchdiffeq, torchmetrics, torchsde, torchvision
(base) [xxx@cachyos-xxx easy-diffusion]$ torchruntime info
--- GPUs ---
0. GPU(vendor_id='1002', vendor_name='Advanced Micro Devices, Inc. [AMD/ATI]', device_id='7480', device_name='Navi 33 [Radeon RX 7600/7600 XT/7600M XT/7600S/7700S / PRO W7600]', is_discrete=True)

--- RECOMMENDED TORCH PLATFORM ---
rocm6.2

--- CONFIGURATION ---
[INFO] Setting env variable HSA_OVERRIDE_GFX_VERSION=11.0.0
[INFO] Setting env variable HIP_VISIBLE_DEVICES=0
(base) [xxx@cachyos-xxx easy-diffusion]$ torchruntime test
[INFO] Setting env variable HSA_OVERRIDE_GFX_VERSION=11.0.0
[INFO] Setting env variable HIP_VISIBLE_DEVICES=0
--- IMPORT TEST ---
Torch version: 2.5.1+rocm6.2
--- / IMPORT TEST ---

--- DEVICE TEST ---
Installed torch platform: cuda
Device count: 1
Torch device (0): cuda:0
Device name (0): AMD Radeon RX 7600
--- / DEVICE TEST ---

--- MATH TEST ---
On torch device: cpu:0
   Simple math:
     x: tensor([0, 1, 2])
     x + 10: tensor([10, 11, 12])
   Norm:
     Size of x: 480.0 Mb on cpu
     Norm (11066.263671875), took 25.6 ms
On torch device: cuda:0
   Simple math:
Ошибка сегментирования (образ памяти сброшен на диск)
(base) [xxx@cachyos-xxx easy-diffusion]$

Rocm Info:

❯ rocminfo
ROCk module is loaded
=====================
HSA System Attributes
=====================
Runtime Version:         1.1
Runtime Ext Version:     1.6
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE
System Endianness:       LITTLE
Mwaitx:                  DISABLED
DMAbuf Support:          YES

==========
HSA Agents
==========
*******
Agent 1
*******
  Name:                    AMD Ryzen 5 3500X 6-Core Processor
  Uuid:                    CPU-XX
  Marketing Name:          AMD Ryzen 5 3500X 6-Core Processor
  Vendor Name:             CPU
  Feature:                 None specified
  Profile:                 FULL_PROFILE
  Float Round Mode:        NEAR
  Max Queue Number:        0(0x0)
  Queue Min Size:          0(0x0)
  Queue Max Size:          0(0x0)
  Queue Type:              MULTI
  Node:                    0
  Device Type:             CPU
  Cache Info:
    L1:                      32768(0x8000) KB
  Chip ID:                 0(0x0)
  ASIC Revision:           0(0x0)
  Cacheline Size:          64(0x40)
  Max Clock Freq. (MHz):   3600
  BDFID:                   0
  Internal Node ID:        0
  Compute Unit:            6
  SIMDs per CU:            0
  Shader Engines:          0
  Shader Arrs. per Eng.:   0
  WatchPts on Addr. Ranges:1
  Memory Properties:
  Features:                None
  Pool Info:
    Pool 1
      Segment:                 GLOBAL; FLAGS: FINE GRAINED
      Size:                    16300016(0xf8b7f0) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Recommended Granule:4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
    Pool 2
      Segment:                 GLOBAL; FLAGS: EXTENDED FINE GRAINED
      Size:                    16300016(0xf8b7f0) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Recommended Granule:4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
    Pool 3
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    16300016(0xf8b7f0) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Recommended Granule:4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
    Pool 4
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED
      Size:                    16300016(0xf8b7f0) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Recommended Granule:4KB
      Alloc Alignment:         4KB
      Accessible by all:       TRUE
  ISA Info:
*******
Agent 2
*******
  Name:                    gfx1102
  Uuid:                    GPU-XX
  Marketing Name:          AMD Radeon RX 7600
  Vendor Name:             AMD
  Feature:                 KERNEL_DISPATCH
  Profile:                 BASE_PROFILE
  Float Round Mode:        NEAR
  Max Queue Number:        128(0x80)
  Queue Min Size:          64(0x40)
  Queue Max Size:          131072(0x20000)
  Queue Type:              MULTI
  Node:                    1
  Device Type:             GPU
  Cache Info:
    L1:                      32(0x20) KB
    L2:                      2048(0x800) KB
  Chip ID:                 29824(0x7480)
  ASIC Revision:           0(0x0)
  Cacheline Size:          128(0x80)
  Max Clock Freq. (MHz):   2356
  BDFID:                   2048
  Internal Node ID:        1
  Compute Unit:            32
  SIMDs per CU:            2
  Shader Engines:          2
  Shader Arrs. per Eng.:   2
  WatchPts on Addr. Ranges:4
  Coherent Host Access:    FALSE
  Memory Properties:
  Features:                KERNEL_DISPATCH
  Fast F16 Operation:      TRUE
  Wavefront Size:          32(0x20)
  Workgroup Max Size:      1024(0x400)
  Workgroup Max Size per Dimension:
    x                        1024(0x400)
    y                        1024(0x400)
    z                        1024(0x400)
  Max Waves Per CU:        32(0x20)
  Max Work-item Per CU:    1024(0x400)
  Grid Max Size:           4294967295(0xffffffff)
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)
    y                        4294967295(0xffffffff)
    z                        4294967295(0xffffffff)
  Max fbarriers/Workgrp:   32
  Packet Processor uCode:: 542
  SDMA engine uCode::      21
  IOMMU Support::          None
  Pool Info:
    Pool 1
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED
      Size:                    8372224(0x7fc000) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Recommended Granule:2048KB
      Alloc Alignment:         4KB
      Accessible by all:       FALSE
    Pool 2
      Segment:                 GLOBAL; FLAGS: EXTENDED FINE GRAINED
      Size:                    8372224(0x7fc000) KB
      Allocatable:             TRUE
      Alloc Granule:           4KB
      Alloc Recommended Granule:2048KB
      Alloc Alignment:         4KB
      Accessible by all:       FALSE
    Pool 3
      Segment:                 GROUP
      Size:                    64(0x40) KB
      Allocatable:             FALSE
      Alloc Granule:           0KB
      Alloc Recommended Granule:0KB
      Alloc Alignment:         0KB
      Accessible by all:       FALSE
  ISA Info:
    ISA 1
      Name:                    amdgcn-amd-amdhsa--gfx1102
      Machine Models:          HSA_MACHINE_MODEL_LARGE
      Profiles:                HSA_PROFILE_BASE
      Default Rounding Mode:   NEAR
      Default Rounding Mode:   NEAR
      Fast f16:                TRUE
      Workgroup Max Size:      1024(0x400)
      Workgroup Max Size per Dimension:
        x                        1024(0x400)
        y                        1024(0x400)
        z                        1024(0x400)
      Grid Max Size:           4294967295(0xffffffff)
      Grid Max Size per Dimension:
        x                        4294967295(0xffffffff)
        y                        4294967295(0xffffffff)
        z                        4294967295(0xffffffff)
      FBarrier Max Size:       32
*** Done ***

❯

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending verificationFixed and pending verification of the fix from the user. No further action necessary until then.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions