Skip to content

Floating point exception with nightly PyTorch and CUDA #11945

@MxtAppz

Description

@MxtAppz

Describe the bug

When running any code snippet using diffusers it fails with floating point exception, and doesn't print any traceback.

For example this one would cause the issue (the example of Stable Diffusion 3.5 medium):

import torch
from diffusers import StableDiffusion3Pipeline

pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-medium", torch_dtype=torch.bfloat16)
pipe = pipe.to("cuda")

image = pipe(
    "A capybara holding a sign that reads Hello World",
    num_inference_steps=40,
    guidance_scale=4.5,
).images[0]
image.save("capybara.png")

The issue could be with upstream PyTorch or CUDA, but we'd need to identify what of Diffusers is causing it.

Reproduction

Not too sure as it's my first time with Diffusers but as suggested by John6666 any NVIDIA GeForce RTX 5000 series... In my case it's a 16gb 5060 Ti. Perhaps CUDA 575.57.08 with CUDA version 12.9 and/or PyTorch 2.9.0.dev20250716+cu129?

Logs

Let me know how can I retrieve any logs you might need.

System Info

diffusers-cli env also causes a Floating point exception, but here you have environment information:

OS: Debian 12

nvidia-smi
Wed Jul 16 15:58:48 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 575.57.08              Driver Version: 575.57.08      CUDA Version: 12.9     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 5060 Ti     On  |   00000000:01:00.0  On |                  N/A |
|  0%   42C    P5              4W /  180W |      10MiB /  16311MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
pip list
Package                  Version
------------------------ ------------------------
bitsandbytes             0.46.1
certifi                  2025.7.14
charset-normalizer       3.4.2
diffusers                0.34.0
filelock                 3.18.0
fsspec                   2025.7.0
hf-xet                   1.1.5
huggingface-hub          0.33.4
idna                     3.10
importlib_metadata       8.7.0
Jinja2                   3.1.6
MarkupSafe               3.0.2
mpmath                   1.3.0
networkx                 3.5
numpy                    2.3.1
nvidia-cublas-cu12       12.9.1.4
nvidia-cuda-cupti-cu12   12.9.79
nvidia-cuda-nvrtc-cu12   12.9.86
nvidia-cuda-runtime-cu12 12.9.79
nvidia-cudnn-cu12        9.10.2.21
nvidia-cufft-cu12        11.4.1.4
nvidia-cufile-cu12       1.14.1.1
nvidia-curand-cu12       10.3.10.19
nvidia-cusolver-cu12     11.7.5.82
nvidia-cusparse-cu12     12.5.10.65
nvidia-cusparselt-cu12   0.7.1
nvidia-nccl-cu12         2.27.5
nvidia-nvjitlink-cu12    12.9.86
nvidia-nvshmem-cu12      3.3.9
nvidia-nvtx-cu12         12.9.79
packaging                25.0
pillow                   11.2.1
pip                      23.0.1
pytorch-triton           3.4.0+gitae848267
PyYAML                   6.0.2
regex                    2024.11.6
requests                 2.32.4
safetensors              0.5.3
setuptools               66.1.1
sympy                    1.14.0
torch                    2.9.0.dev20250716+cu129
torchaudio               2.8.0.dev20250716+cu129
torchvision              0.24.0.dev20250716+cu129
tqdm                     4.67.1
triton                   3.3.1
typing_extensions        4.14.1
urllib3                  2.5.0
zipp                     3.23.0

Don't hesitate to tell me any other info you might need.

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions