-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic support for Intel XPU (Arc Graphics) #409
Conversation
PS: If use elif vram_state == XPU:
+ real_model = torch.xpu.optimize(real_model)
real_model.to("xpu")
pass |
By default should XPU have priority over CUDA if both are present? |
It will first check whether |
I'm asking because some computers have integrated intel GPUs with a Nvidia GPU and I'm wondering if it could cause issues. |
Probably not, because pytorch does not support XPU by default, need to install |
@comfyanonymous Is it possible to merge this PR, or what else is wrong with it? |
Update: I noticed the Experimental Codeless Optimization (ipexrun), but it seems to be cpu-only for now. Consider manually adding Waiting for |
After looking at this pull request a bit XPU should not be treated as another vram state. It makes sense for CPU and MPS to be because they don't have any vram but with XPU there's actually vram so it would be good if --lowvram and --highvram worked. |
That may need to be changed in more depth, but I do agree with that. |
Looks related to this issue: #39 Tested:
|
I did a small refactor so if you can confirm it still works that would be great: bceccca |
No problem, it still works. |
Hi, I am unable to get any sort of generation working on my A770 by following the instructions in the first post: Traceback (most recent call last): File "/home/kot/Documents/ComfyUI/execution.py", line 184, in execute executed += recursive_execute(self.server, prompt, self.outputs, x, extra_data) File "/home/kot/Documents/ComfyUI/execution.py", line 60, in recursive_execute executed += recursive_execute(server, prompt, outputs, input_unique_id, extra_data) File "/home/kot/Documents/ComfyUI/execution.py", line 60, in recursive_execute executed += recursive_execute(server, prompt, outputs, input_unique_id, extra_data) File "/home/kot/Documents/ComfyUI/execution.py", line 69, in recursive_execute outputs[unique_id] = getattr(obj, obj.FUNCTION)(**input_data_all) File "/home/kot/Documents/ComfyUI/nodes.py", line 768, in sample return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) File "/home/kot/Documents/ComfyUI/nodes.py", line 699, in common_ksampler comfy.model_management.load_model_gpu(model) File "/home/kot/Documents/ComfyUI/comfy/model_management.py", line 168, in load_model_gpu real_model.to(get_torch_device()) File "/home/kot/Documents/ComfyUI/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 987, in to return self._apply(convert) File "/home/kot/Documents/ComfyUI/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 639, in _apply module._apply(fn) File "/home/kot/Documents/ComfyUI/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 639, in _apply module._apply(fn) File "/home/kot/Documents/ComfyUI/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 639, in _apply module._apply(fn) [Previous line repeated 1 more time] File "/home/kot/Documents/ComfyUI/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 662, in _apply param_applied = fn(param) File "/home/kot/Documents/ComfyUI/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 985, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) RuntimeError: Native API failed. Native API returns: -997 (The plugin has emitted a backend specific error) -997 (The plugin has emitted a backend specific error) A quick Google search shows me this issue: intel/compute-runtime#617, so it seems it's failing to allocate more than 8GB VRAM. |
I have not encountered this problem. Are you using AUR's |
Yes, I used the |
Perhaps you could try installing the oneAPI AI Kit, see #476 Or LOW_VRAM mode: |
Sadly no luck with AIKit or lowvram. Does it matter that I'm using my own instance of Python instead of Intel Python (included in AIKit)? |
If you are not using the Intel Python that comes with AI Kit, installing it will make no noticeable difference |
I recreated the venv with Intel Python:
But I get the same error as before. Model is Counterfeit v2.5. |
Hmm.... This is a bit tricky. Can you test the output of the |
sycl-ls:
Python:
|
Looks normal, I probably don't have a proper workaround. But I didn't get this warning: /home/kot/Documents/ComfyUI/venv/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}") |
closed #387
Note:
need to install the oneAPI Base Toolkit first, on Arch Linux it is
paru -S intel-oneapi-basekit intel-compute-runtime-bin
Maybe it also depends on the oneAPI AI Analytics Toolkit, I'm not sure
Then run:
If
--use-split-cross-attention
is not used, output is noise.Verify XPU availability under the ComfyUI folder where dependencies have been installed:
Known issues:
Noise occurs when batch is larger than one, even with--use-split-cross-attention
--use-split-cross-attention
is not used, it is 100%