Skip to content

[Bug] LLM CUDA works, image model import fails after Repair. #11545

Closed

Description

@ericridderstrom

Environment

Where are you using Unsloth?

  • Unsloth desktop application
  • Unsloth web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version:

Debian GNU/Linux 13 (Trixie), x86_64
Kernel: 6.12.107+deb13-amd64

GPU model(s) and accelerator backend:

NVIDIA GeForce GTX 960M, 4 GiB VRAM
NVIDIA CUDA backend
GPU architecture: Maxwell GM107
CUDA compute capability: 5.0

Hybrid graphics system also contains Intel HD Graphics 530.

NVIDIA proprietary driver: 550.163.01

nvidia-smi detects the GTX 960M correctly and reports CUDA 12.4 driver capability.

PyTorch also detects the GPU successfully:

  • torch.cuda.is_available(): True
  • GPU: NVIDIA GeForce GTX 960M
  • Compute capability: (5, 0)

Versions:

Unsloth Desktop: 0.1.811-beta

Python: 3.13.5

Python packages in the Unsloth-managed environment:

  • unsloth: 2026.9.7
  • unsloth_zoo: 2026.9.6
  • torch: 2.6.0+cu124
  • xformers: 0.0.35
  • triton: 3.2.0
  • diffusers: 0.40.0
  • transformers: 5.5.0
  • peft: 0.18.1

The environment was created/repaired by the Unsloth Desktop application's
Repair Installation function.

What happened?

After installing the NVIDIA proprietary driver, Unsloth initially detected the
GTX 960M but reported that the installed PyTorch build was CPU-only.

I used the Unsloth Desktop Repair Installation function.

After repair, CUDA started working correctly through the GTX 960M. PyTorch now
reports CUDA as available and the GPU is successfully detected.

However, selecting an image/diffusion model results in an import failure
involving diffusers, peft, and xformers.

Further diagnostics show that the repaired environment contains
torch 2.6.0+cu124 together with xformers 0.0.35, even though the installed
xFormers package declares:

Requires-Dist: torch>=2.10

pip check therefore reports:

xformers 0.0.35 has requirement torch>=2.10, but you have torch 2.6.0+cu124.

Additionally, importing xFormers reports that its C++/CUDA extensions were
built for a different PyTorch, CUDA, and Python environment:

PyTorch 2.10.0+cu128 with CUDA 1208

Python 3.10.19

while the Unsloth environment actually contains:

PyTorch 2.6.0+cu124

Python 3.13.5

This results in an incompatible aten::_flash_attention_forward schema.

Steps to reproduce:

  1. Install/run Unsloth Desktop 0.1.811-beta on Debian 13 with an NVIDIA
    GeForce GTX 960M.
  2. Run Unsloth Desktop's Repair Installation function to repair the
    CPU-only PyTorch installation and enable CUDA.
  3. Confirm that PyTorch can successfully access the GTX 960M.
  4. Select/load an image/diffusion model in Unsloth Desktop.
  5. The model fails during import with an xFormers/PyTorch
    aten::_flash_attention_forward schema incompatibility.

Expected behavior:

The Repair Installation function should install a mutually compatible set of
PyTorch, xFormers, CUDA-related, and Unsloth dependencies.

If xFormers/Flash Attention is unsupported on this GPU architecture, I would
expect Unsloth to either use a compatible fallback attention implementation or
report that the acceleration method/GPU is unsupported, rather than failing
during diffusers/peft import.

Actual behavior:

CUDA itself works after Repair Installation, but image/diffusion model loading
fails because the installed xFormers binary/package is incompatible with the
installed PyTorch environment.

xFormers reports:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions.

xFormers was built for:

PyTorch 2.10.0+cu128 with CUDA 1208 (you have 2.6.0+cu124)

Python 3.10.19 (you have 3.13.5)

The resulting import error is:

ImportError: Current Torch with Flash-Attention 2.5.7 doesnt have a compatible aten::_flash_attention_forward schema

The expected schema ends with:

(Tensor output, Tensor softmax_logsumexp, Tensor rng_state, Tensor unused, Tensor debug_attn_mask)

while the installed PyTorch schema returns:

(Tensor output, Tensor softmax_logsumexp, Tensor philox_seed, Tensor philox_offset, Tensor debug_attn_mask)

Model and operation involved:

Model: Qwen-Image-GGUF, Z-Image-Turbo

Operation: Image/diffusion model loading in Unsloth Desktop.

The failure occurs during Python module import before the model can be used.

LLM/CUDA functionality appears to work after Repair Installation; the problem
has been observed specifically when selecting an image/diffusion model.

Diagnostics and logs

Desktop application

Copy Diagnostics output:

Failed to import diffusers.models.transformers.transformer_qwenimage because of the following error (look up to see its traceback): Failed to import diffusers.loaders.peft because of the following error (look up to see its traceback): Current Torch with Flash-Attention 2.5.7 doesnt have a compatible aten::_flash_attention_forward schema EXPECTED: aten::_flash_attention_forward(Tensor query, Tensor key, Tensor value, Tensor? cum_seq_q, Tensor? cum_seq_k, SymInt max_q, SymInt max_k, float dropout_p, bool is_causal, bool return_debug_mask, *, float? scale=None, SymInt? window_size_left=None, SymInt? window_size_right=None, Tensor? seqused_k=None, Tensor? alibi_slopes=None) -> (Tensor output, Tensor softmax_logsumexp, Tensor rng_state, Tensor unused, Tensor debug_attn_mask) but GOT: aten::_flash_attention_forward(Tensor query, Tensor key, Tensor value, Tensor? cum_seq_q, Tensor? cum_seq_k, SymInt max_q, SymInt max_k, float dropout_p, bool is_causal, bool return_debug_mask, *, float? scale=None, SymInt? window_size_left=None, SymInt? window_size_right=None, Tensor? seqused_k=None, Tensor? alibi_slopes=None) -> (Tensor output, Tensor softmax_logsumexp, Tensor philox_seed, Tensor philox_offset, Tensor debug_attn_mask)

Relevant Python environment diagnostics:

Python:
3.13.5

PyTorch:
2.6.0+cu124

PyTorch CUDA:
12.4

CUDA available:
True

GPU:
NVIDIA GeForce GTX 960M

Compute capability:
(5, 0)

xFormers:
0.0.35

xFormers runtime diagnostic:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
PyTorch 2.10.0+cu128 with CUDA 1208 (you have 2.6.0+cu124)
Python 3.10.19 (you have 3.13.5)

Memory-efficient attention, SwiGLU, sparse and more won't be available.

Installed package versions:

unsloth 2026.9.7
unsloth_zoo 2026.9.6
torch 2.6.0+cu124
xformers 0.0.35
triton 3.2.0
diffusers 0.40.0
transformers 5.5.0
peft 0.18.1

Relevant pip check results:

xformers 0.0.35 has requirement torch>=2.10, but you have torch 2.6.0+cu124.

There are also unrelated dependency warnings reported by pip check:

descript-audiotools 0.7.2 requires ipython, which is not installed.
data-designer-config 0.5.4 has requirement rich<15,>=13.7.1, but you have rich 15.0.0.
descript-audiotools 0.7.2 has requirement protobuf<3.20,>=3.9.2, but you have protobuf 7.36.2.
sqlfluff 3.5.0 has requirement click<=8.3.0, but you have click 8.5.0.

The relevant xFormers package metadata is:

Name: xformers
Version: 0.0.35
Requires-Python: >=3.9
Requires-Dist: torch>=2.10
Requires-Dist: numpy
Installer: uv

Additional context

Before running Repair Installation, Unsloth detected the NVIDIA GTX 960M but
reported that PyTorch was a CPU-only build (2.11.0+cpu).

After Repair Installation, PyTorch was changed to 2.6.0+cu124, and CUDA
started working correctly with the GTX 960M.

Therefore, the NVIDIA driver and basic PyTorch CUDA functionality appear to be
working. The failure occurs specifically in the repaired Python dependency
stack when xFormers is imported while loading an image/diffusion model.

No manual pip install, xFormers upgrade, Flash Attention installation, or
system CUDA Toolkit installation was performed after Repair Installation.

The GPU is an older Maxwell-generation GTX 960M with compute capability 5.0,
so it is also possible that current xFormers/Flash Attention kernels do not
support this architecture. A fallback to standard PyTorch attention may be
necessary if that is the case.

Activity

  1. added
    feature request
    on Sep 22, 2026
  2. oobabooga commented on Sep 28, 2026

    @oobabooga
    Member

    I'm closing this as fixed by #11847, which removes an xFormers build whose torch requirement can't be satisfied and hides it before diffusers imports it. It's merged but not in a release yet.

    Note that on torch 2.6 there's a separate diffusers/torchao mismatch that PR doesn't cover, so if image models still fail after updating, please let me know.

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

    bugfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions