#4164·Fooocus

[Bug]: RuntimeError: CUDA error: no kernel image is available

Author: DragoChopsCreated Mar 25, 2026Updated Jun 28, 2026
Labelsbugtriage

Checklist

  • The issue has not been resolved by following the troubleshooting guide
  • The issue exists on a clean installation of Fooocus
  • The issue exists in the current version of Fooocus
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

That is the full error i think. I'm very new to this, i looked through the issues list and didnt find anything that really addressed this. I first had an issue where my descrete nvidia wasnt turned on. Fixing that now Everytime i launch it properly makes it to the website but when i attempt to generate any form of image i get the error above.

Tried a fresh install. Tried to install an older version of python that a similar cuda issue recommended.

Help.

Steps to reproduce the problem

  1. Install
  2. Generate image
  3. Error

What should have happened?

Generate an image?

What browsers do you use to access Fooocus?

Google Chrome

Where are you running Fooocus?

Locally

What operating system are you using?

Window 11

Console logs

C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0>.\python_embeded\python.exe -s Fooocus\entry_with_update.py
Fast-forward merge
Update succeeded.
[System ARGV] ['Fooocus\\entry_with_update.py']
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Fooocus version: 2.5.5
Error checking version for opencv-contrib-python-headless: No package metadata was found for opencv-contrib-python-headless
Installing requirements
[Cleanup] Attempting to delete content of temp dir C:\Users\natsu\AppData\Local\Temp\fooocus
[Cleanup] Cleanup successful
Downloading: "https://huggingface.co/mashb1t/misc/resolve/main/xl-to-v1_interposer-v4.0.safetensors" to C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\models\vae_approx\\\xl-to-v1_interposer-v4.0.safetensors

100%|█████████████████████████████████████████████████████████████████████████████| 5.40M/5.40M [00:00<00:00, 11.5MB/s]
Downloading: "https://huggingface.co/lllyasviel/fav_models/resolve/main/fav/juggernautXL_v8Rundiffusion.safetensors" to C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors

100%|█████████████████████████████████████████████████████████████████████████████| 6.62G/6.62G [09:15<00:00, 12.8MB/s]
C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\cuda\__init__.py:215: UserWarning:
NVIDIA GeForce RTX 5060 Laptop GPU with CUDA capability sm_120 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 sm_90.
If you want to use the NVIDIA GeForce RTX 5060 Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(
Total VRAM 8151 MB, total RAM 16092 MB
Set vram state to: NORMAL_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce RTX 5060 Laptop GPU : native
VAE dtype: torch.bfloat16
Using pytorch cross attention
Refiner unloaded.
IMPORTANT: You are using gradio version 3.41.2, however version 4.44.1 is available, please upgrade.
--------
Running on local URL:  http://127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
Base model loaded: C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors
VAE loaded: None
Request to load LoRAs [('sd_xl_offset_example-lora_1.0.safetensors', 0.1)] for model [C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors].
Loaded LoRA [C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\models\loras\sd_xl_offset_example-lora_1.0.safetensors] for UNet [C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\models\checkpoints\juggernautXL_v8Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  return self.fget.__get__(instance, owner)()
Fooocus Expansion engine loaded for cuda:0, use_fp16 = True.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.53 seconds
Started worker with PID 4220
App started successful. Use the app with http://127.0.0.1:7865/ or 127.0.0.1:7865
[Parameters] Adaptive CFG = 7
[Parameters] CLIP Skip = 2
[Parameters] Sharpness = 2
[Parameters] ControlNet Softness = 0.25
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] Seed = 5853435486777615268
[Parameters] CFG = 4
[Fooocus] Loading control models ...
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
Traceback (most recent call last):
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\modules\async_worker.py", line 1471, in worker
    handler(task)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\\\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\\\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\modules\async_worker.py", line 1160, in handler
    tasks, use_expansion, loras, current_progress = process_prompt(async_task, async_task.prompt, async_task.negative_prompt,
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\modules\async_worker.py", line 738, in process_prompt
    expansion = pipeline.final_expansion(t['task_prompt'], t['task_seed'])
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\\\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\\\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\Fooocus\extras\expansion.py", line 120, in __call__
    features = self.model.generate(**tokenized_kwargs,
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\torch\\\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\transformers\generation\\\utils.py", line 1664, in generate
    self._prepare_special_tokens(generation_config, kwargs_has_attention_mask, device=device)
  File "C:\Users\natsu\OneDrive\Desktop\Fooocus_win64_2-5-0\python_embeded\lib\site-packages\transformers\generation\\\utils.py", line 1513, in _prepare_special_tokens
    if eos_token_id is not None and torch.isin(elements=eos_token_id, test_elements=pad_token_id).any():
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Total time: 2.43 seconds

Additional information

No response