Comfy-Org / Comfy-Org/ComfyUI

KSampler error on Kaggle notebook for ComfyUI

Open
#1,799 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

Hello. I'm using ComfyUI on Kaggle and I'm getting a KSampler error. On Colab everything works fine as long as Google doesn't turn you off from it.

Here is the error:
Error occurred when executing KSampler:

CUDA error: CUDA driver version is insufficient for CUDA runtime version
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.

File "/kaggle/working/ComfyUI/execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/kaggle/working/ComfyUI/execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/kaggle/working/ComfyUI/execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/kaggle/working/ComfyUI/nodes.py", line 1237, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "/kaggle/working/ComfyUI/nodes.py", line 1207, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "/kaggle/working/ComfyUI/comfy/sample.py", line 97, in sample
samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 781, in sample
return sample(self.model, noise, positive, negative, cfg, self.device, sampler(), sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 686, in sample
samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 638, in sample
samples = getattr(k_diffusion_sampling, "sample_{}".format(sampler_name))(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **extra_options)
File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/k_diffusion/sampling.py", line 137, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 326, in forward
out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/k_diffusion/external.py", line 125, in forward
eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
File "/kaggle/working/ComfyUI/comfy/k_diffusion/external.py", line 151, in get_eps
return self.inner_model.apply_model(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 314, in apply_model
out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 292, in sampling_function
cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, model_options)
File "/kaggle/working/ComfyUI/comfy/samplers.py", line 268, in calc_cond_uncond_batch
output = model_function(input_x, timestep_, **c).chunk(batch_chunks)
File "/kaggle/working/ComfyUI/comfy/model_base.py", line 64, in apply_model
return self.diffusion_model(xc, t, context=context, y=c_adm, control=control, transformer_options=transformer_options).float()
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 625, in forward
h = forward_timestep_embed(module, h, emb, context, transformer_options)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 56, in forward_timestep_embed
x = layer(x, context, transformer_options)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 534, in forward
x = block(x, context=context[i], transformer_options=transformer_options)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 364, in forward
return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/diffusionmodules/util.py", line 123, in checkpoint
return func(*inputs)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 429, in _forward
n = self.attn1(n, context=context_attn1, value=value_attn1)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 340, in forward
out = optimized_attention(q, k, v, self.heads)
File "/kaggle/working/ComfyUI/comfy/ldm/modules/attention.py", line 267, in attention_xformers
out = xformers.ops.memory_efficient_attention(q, k, v, attn_bias=None)
File "/opt/conda/lib/python3.10/site-packages/xformers/ops/fmha/__init__.py", line 223, in memory_efficient_attention
return _memory_efficient_attention(
File "/opt/conda/lib/python3.10/site-packages/xformers/ops/fmha/__init__.py", line 321, in _memory_efficient_attention
return _memory_efficient_attention_forward(
File "/opt/conda/lib/python3.10/site-packages/xformers/ops/fmha/__init__.py", line 341, in _memory_efficient_attention_forward
out, *_ = op.apply(inp, needs_gradient=False)
File "/opt/conda/lib/python3.10/site-packages/xformers/ops/fmha/cutlass.py", line 196, in apply
return cls.apply_bmhk(inp, needs_gradient=needs_gradient)
File "/opt/conda/lib/python3.10/site-packages/xformers/ops/fmha/cutlass.py", line 260, in apply_bmhk
out, lse, rng_seed, rng_offset = cls.OPERATOR(
File "/opt/conda/lib/python3.10/site-packages/torch/_ops.py", line 692, in __call__
return self._op(*args, **kwargs or {})

After I changed cu118 to cu121 in notebook cell, then I'm the following error when trying to launch Comfy:

Traceback (most recent call last):
File "/kaggle/working/ComfyUI/main.py", line 72, in
import execution
File "/kaggle/working/ComfyUI/execution.py", line 12, in
import nodes
File "/kaggle/working/ComfyUI/nodes.py", line 20, in
import comfy.diffusers_load
File "/kaggle/working/ComfyUI/comfy/diffusers_load.py", line 4, in
import comfy.sd
File "/kaggle/working/ComfyUI/comfy/sd.py", line 5, in
from comfy import model_management
File "/kaggle/working/ComfyUI/comfy/model_management.py", line 114, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
File "/kaggle/working/ComfyUI/comfy/model_management.py", line 83, in get_torch_device
return torch.device(torch.cuda.current_device())
File "/opt/conda/lib/python3.10/site-packages/torch/cuda/__init__.py", line 769, in current_device
_lazy_init()
File "/opt/conda/lib/python3.10/site-packages/torch/cuda/__init__.py", line 298, in _lazy_init
torch._C._cuda_init()
RuntimeError: The NVIDIA driver on your system is too old (found version 11040). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org/ to install a PyTorch version that has been compiled with your version of the CUDA driver.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.