Intel Arc Graphics Thread #476
Replies: 40 comments 132 replies
-
UPDATE:
Before Intel update it, the code needs to be modified like this to avoid reporting errors: - match operation:
- case "multiply":
- output[top:bottom, left:right] = destination_portion * source_portion
- case "add":
- output[top:bottom, left:right] = destination_portion + source_portion
- case "subtract":
- output[top:bottom, left:right] = destination_portion - source_portion
+ if operation == "multiply":
+ output[top:bottom, left:right] = destination_portion * source_portion
+ elif operation == "add":
+ output[top:bottom, left:right] = destination_portion + source_portion
+ elif operation == "subtract":
+ output[top:bottom, left:right] = destination_portion - source_portion Of course not modifying it doesn't seem to affect normal usage. |
Beta Was this translation helpful? Give feedback.
-
About Karras scheduler: Currently using it causes a -996 "uses-fp64-math" error, which may be fixed in the next IPEX release (intel/intel-extension-for-pytorch#285) Until then, can specify to use # comfy/samplers.py
- sigmas = k_diffusion_sampling.get_sigmas_karras(n=steps, sigma_min=self.sigma_min, sigma_max=self.sigma_max, device=self.device)
+ sigmas = k_diffusion_sampling.get_sigmas_karras(n=steps, sigma_min=self.sigma_min, sigma_max=self.sigma_max, device="cpu") |
Beta Was this translation helpful? Give feedback.
-
is it Linux only or can you use this on a win10 machine? |
Beta Was this translation helpful? Give feedback.
-
So again, sharing the good news. An XPU version of their Pytorch extension with Pytorch 2.0 support, Hats off to ComfyUI for being the only Stable Diffusion UI to be able to do it at the moment but there are a bunch of caveats with running Arc and Stable Diffusion right now from the research I have done. As of the time of posting: 1.) Setup can still be complicated in some respects and can randomly not work because Intel is only really verifying for enterprise Linux distributions and Ubuntu. My base Linux Fedora 38 install has the RPMs installed but I get a cryptic error regarding the runtime saying 2.) From what I have read at intel/intel-extension-for-pytorch#398, there is no native Windows version for some wheels to get 3.) Intel Arc right now has a huge problem with allocating more than 4GB of VRAM in IPEX even though the card has more VRAM in the case of the A750/A770 according to intel/intel-extension-for-pytorch#325. This seems to have mitigations elsewhere in Intel's oneAPI stack like their OpenCL compute runtime where anything you compile, you can work your code to go around the restriction via some flags and changed code according to intel/compute-runtime#627. No workarounds, it seems, until someone gets Intel to fix it. 4.) Because of that, experimenting with other Stable Diffusion UIs, it seems like every once in a while, Arc will occasionally run out of VRAM if you decide to not use lower VRAM flags and throw a 5.) Intel has an equivalent to
I'm not even sure if I'm sure that Intel GPU support will not a big priority at the moment for the project, given the big blocker at this point is the 4GB VRAM limit which needs to be fixed by Intel. But that being said, things should be working a lot better than it is at the moment, maybe not average user ready, but should be ready for any mildly technical person. I really want to play with ComfyUI more but I really don't want to restart the application server for every several image I might want to generate even or rolling a dice for SDXL to actually finish a workflow. But the Arc cards are strong. I managed to equal the Nvidia RTX 3070 Ti in certain Stable Diffusion workflows with my 16 GB Intel Arc A770 so I look forward to the future when things are more mature and all the stars are aligned. Also not sure what issues need to be open here but there is potentially 2-3 of them that could be made from my report. Edit: Added a caveat I forgot to mention and filled in some information and fixed some typos. |
Beta Was this translation helpful? Give feedback.
-
So this took me a bit of time, but I have the Docker image I used published here so hopefully someone can find it useful. Some things to note I've found while poking and experimenting with things. 1.) A lot of the issues are gone mentioned before by @kwaa months ago like the Karras scheduler not working, where it is working now even with the new dpmpp_3 schedulers, or noise issues if not using split attention which is gone for the most part unless your graphics driver has crashed too many times and a restart of the computer fixes that. Anyways, hope people have good success with it like I did. I might try and see why ipexrun is failing but for now, I am going to take a break. Edit: Added in a caveat I forgot to mention and fixed some typos. |
Beta Was this translation helpful? Give feedback.
-
In the event anyone else missed it: I seem to be missing the file that gets sourced from /opt/intel, too... may edit this post once I figure it out. |
Beta Was this translation helpful? Give feedback.
-
Well, short story. After spend whole day to install Arch Linux on Windows 10 WSL (2 in my case). After all procedures, I stuck on
The installer reach a 87% and starts roll back all changes, because intel-oneapi-basekit not contain library libtbb.so.12 that needed to install oneAPI AI Analytics Toolkit v2023. The packgage that contains needed library is intel-oneapi-compiler-shared-runtime but it conflict with intel-oneapi-basekit. Because the istall procedure can't finish with intel-oneapi-basekit, I install intel-oneapi-compiler-shared-runtime. ComfyUI runs: [{user}@pc ArchLinux]$
But if i try to generate image I get an next error:
As can see, I tries params like --force-fp16 --bf16-vae --lowvram --use-split-cross-attention --highvram but it's have no effect. So, models are loaded, but KSampler are crashes. And that's my dead end, because I have no idea what's going on. Not in ComfyUI itself, and also there more in Linux Arch. But I suppose this can be a kind of report. |
Beta Was this translation helpful? Give feedback.
-
I don't use Windows, but all the pieces should be together to run ComfyUI on Windows now without any horrible downsides like no AOT compilation or missing packages since a new unofficial Intel Extension for Python package has been released without needing any installation of external dependencies and bundling it all together. It remains to be seen whether there will ever be an official package that does this so this package is the best chance anyone has at actually using Arc on Windows natively. According to reports, it is a bit faster than WSL2 but slower than Linux native. The rough steps to do this should be roughly the same as the process outlined in the opening post for Linux minus platform-specific things. 1.) Make sure you install an Intel driver that is 4952 or newer. The latest driver can be found here python -m ensurepip --upgrade 3.) Install git from here using the GUI installer or other means. cd <location where to place ComfyUI>
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI 5.) Download non-official Intel Extension for Pytorch packages here and install the packages with pip. Assuming they are all put in the root of the ComfyUI repository, run this command line. pip install intel_extension_for_pytorch-2.0.110+git0f2597b-cp310-cp310-win_amd64.whl torch-2.0.0a0+gite9ebda2-cp310-cp310-win_amd64.whl torchvision-0.15.2a0+fa99a53-cp310-cp310-win_amd64.whl Again, I will need to remind you this is unofficial and does have a degree of risk but it should be mostly safe. 6.) Finish the rest of the installation pip install -r requirements.txt At this point, you should be done with the installation. To run ComfyUI each time from scratch, open a terminal/command prompt. Then run the following command lines replacing <> with your own input: cd <location of ComfyUI>
python main.py <Any extra ComfyUI arguments you want to use> |
Beta Was this translation helpful? Give feedback.
-
Reinstall in forced mode, needed dll in place, but still get this error. Can it be relevant to folder rights or upper or lower letter case in "user"? |
Beta Was this translation helpful? Give feedback.
-
There really needs to be a better, more updated tutorial for this. Much of the information is stretched out over the thread and mixed up with information between Linux and Windows |
Beta Was this translation helpful? Give feedback.
-
To install on Ubuntu. 1.) Install Linux drivers with the following instructions provided by Intel here sudo apt install python3-pip git 3.) Install ComfyUI with the following terminal commands replacing the <> portion with a selection of your choice. cd <Location to put ComfyUI>
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI 4.) Install all the Intel Extension for Pytorch pip Python packages first with this terminal command. python -m pip install torch==2.0.1a0 torchvision==0.15.2a0 intel-extension-for-pytorch==2.0.110+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ 5.) Finish the rest of the dependency installation with this terminal command: pip install -r requirements.txt Installation should be done at this point. To run ComfyUI, one can type in the following terminal commands replacing <> with your own input: cd <location of ComfyUI>
python main.py <Any extra ComfyUI arguments you want to use> For other Linux distros outside of Arch Linux or Ubuntu, one will need to manually install the Intel compute runtime, git, a Python with a version supported by Intel Extension for Pytorch like 3.10 as of the time of this writing or using Intel's Python from the AI Kit which will provide that, pip, and any other dependencies required according to your own Linux distribution's package manager or install scripts but one should be able to then just follow step 3 and onwards without any issue afterwards. |
Beta Was this translation helpful? Give feedback.
-
I've updated the Arch Linux setup guide for the latest IPEX and ComfyUI, without oneAPI AI Kit. If anyone wants to uninstall the previously installed AI Kit, it's available: cd /opt/intel/oneapi/installer
sudo ./installer --action remove --product-id intel.oneapi.lin.aikit.product --product-ver 2023.1.0-31760
# if you don't need
paru -Rsc libxcrypt-compat |
Beta Was this translation helpful? Give feedback.
-
New Patch!Thanks to vladmandic/automatic for the code. contributors Basically, you just need to copy Then modify try:
import intel_extension_for_pytorch as ipex
if torch.xpu.is_available():
xpu_available = True
+ from attention import attention_init
+ ok, e = attention_init()
except:
pass It could partially fix intel/intel-extension-for-pytorch#325. (so f**k you, intel) |
Beta Was this translation helpful? Give feedback.
-
Cool... Got it working with WSL2 using Arch. Followed the instructions at the top, as well as installed jemalloc paru(root/native environment), openmp via pip(venv). There are issues with the env vars as Arch is pulling my windows env vars through. So I some times have to re run the setvars.sh. I get warnings about libpng when I run via python or ipexrun. Everything still works though. I generally run through ipexrun but add xpu to the command i.e.
Apart from some memory overruns I've had no issues the last few days. |
Beta Was this translation helpful? Give feedback.
-
anybody can tell where intel store their patches for pytorch? |
Beta Was this translation helpful? Give feedback.
-
In an unusual but welcome move, Intel released a version of Intel Extension for Pytorch for XPU, v2.1.30+xpu, that has the fixes needed to run ComfyUI on Linux and Windows without code modifications, from what wheels I could see in the repository. I was able to verify SD 1.5 is working, but SDXL is being a bit wonky on my end so I need some further time to test it out and see what is up. Do note as well that Linux and the Intel Compute Runtime currently as of writing this has some outstanding issues that are being worked through with the latest versions like this which may be related to my issue so tread carefully. If anyone can verify that this can run ComfyUI without any changes, that would be great so I can move forward with creating a pull request for some code changes I have been meaning to merge into the project. Edit: I verified that SDXL is working for the most part but it is pretty unstable without VRAM reduction built in for higher resolution images and I am getting hit by the slower speed Intel generation speeds by the bug I mentioned above so it's best to stay on a kernel at 6.6.25 LTS/6.8.4 or lower if possible to avoid getting slowdowns at this time. Might change in the future. |
Beta Was this translation helpful? Give feedback.
-
This seems to be the last working recipe for me (Arch Linux): #476 (comment) Since that posting the situation devolved significantly from running ComfyUI out of the box:
Am I holding it wrong or is that what it is at the moment? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Just reporting here that SD3 does indeed work, |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if anyone else has been having this issue with Archlinux, but a fairly fresh OS install, following the usual instructions, creating a venv environment with python 3.11, installing the latest intel extension for pytorch, setting the setvars.sh, oneapi all installed, but go to run ComfyUI and I get an import error: libintel-ext-pt-gpu.so: undefined symbol: _ZNK4sycl3_V16detail16AccessorBaseHost25isMemoryObjectUsedByGraphEv |
Beta Was this translation helpful? Give feedback.
-
Any experience wether intel is any good or cost effective in this regard? After buying my 4090, I want to experiment with other types of GPUs, because half price for same or more ram in next gen will make me veer towards other brands, because Nvidia is screwing us all with their failure to have done a 48GB Vram version of the 4090. |
Beta Was this translation helpful? Give feedback.
-
How can I use IPAdapter?
|
Beta Was this translation helpful? Give feedback.
-
Intel has released IPEX v2.1.40+xpu and oneAPI 2024.2 which solves some outstanding issues like one where VAE Decode would hang and segfault which some people had with a faulty package upgrade which the update also fixes. |
Beta Was this translation helpful? Give feedback.
-
I could run FLUX dev example workflow with fp8+fp8 75sec on windows (which is 10sec faster than RTX3060), until it uses shared GPU memory. I am going to try GGUF quants today. |
Beta Was this translation helpful? Give feedback.
-
With new option
you may need more value for Previously, generation become very slow, when it starts using shared VRAM. Generation took 62.04sec(2.61s/it) for 1024x1024 20steps with fp8 of flux and t5-v1_1-xxl-encoder-Q5_K_M.gguf. |
Beta Was this translation helpful? Give feedback.
-
I noticed pytorch has some xpu nightlies for both linux and windows that can be installed with:
How well do these work? |
Beta Was this translation helpful? Give feedback.
-
The new
This allowed for |
Beta Was this translation helpful? Give feedback.
-
I got an error. Are the versions in your command correct? Arch Linux. $ pip install torch==2.0.1a0 torchvision==0.15.2a0 intel-extension-for-pytorch==2.0.120+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl-aitools/ Looking in indexes: https://pypi.org/simple, https://pytorch-extension.intel.com/release-whl-aitools/ |
Beta Was this translation helpful? Give feedback.
-
SDXL Checkpoint Not Utilizing Intel Arc GraphicsHey everyone, I've been following the instructions from #intel-gpus and the installation guide for the platform GPU version v2.3.110+xpu on WSL2 (Ubuntu 24.04). My hardware setup includes an Intel® Core™ Ultra 9 185H and Intel® Arc™ Graphics on a Windows 11 laptop, running Python 3.11.10. I've installed the Intel® Arc™ & Iris® Xe Graphics - WHQL - Windows* 32.0.101.5768 and followed the installation guide for Intel's oneAPI Basekit without any issues. I also checked out the 950.13, but I passed on it since I'm using Ubuntu 24.04. According to the Installing Client GPUs guide, "The easiest option is to use the Ubuntu Desktop-supplied Hardware Enablement (HWE) starting with Ubuntu 23.04 for integrated and discrete graphics. This is the simplest option and does not require any custom settings." I installed the Python dependencies using the following command: python -m pip install torch==2.3.1+cxx11.abi torchvision==0.18.1+cxx11.abi torchaudio==2.3.1+cxx11.abi intel-extension-for-pytorch==2.3.110+xpu oneccl_bind_pt==2.3.100+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ After completing the virtual environment setup and installing the repository dependencies, I ran the sanity test and received the following output:
Additionally, I then started ComfyUI using the following commands: source .venv/bin/activate
source /opt/intel/oneapi/setvars.sh
python main.py --use-pytorch-cross-attention --highvram The initialization seemed to work fine, and the server started without any errors. However, when I ran an SDXL checkpoint, it did not utilize the Arc Graphics. Here is the complete server log:
Any ideas on what might be going wrong? Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
-
Unless you're running a very specific version of a NVIDIA graphics card on Linux with a very specific version of CUDA and have very specific software installed in a very specific order and way, forget about getting AI generated images to work on your computer. Ignore what you hear and see otherwise, it's not possible. Save yourself the time and headache of this massive software and hardware Cluster F... and just pay for a subscription on a website if you want to generate AI images. |
Beta Was this translation helpful? Give feedback.
-
ComfyUI now supports Intel Arc Graphics. (#409)
Since the installation tutorial for Intel Arc Graphics is quite long, I'll write it here first.
Intel Extension for PyTorch is currently only available for Linux, so you will need to have a Linux or WSL environment.
Arch Linux (with
paru
) are used here as example operating systems.Install Python and PIP:
Install Intel Compute Runtime and Intel oneAPI Base Kit:
Install ComfyUI:
Install Dependencies (via
venv
):python -m venv venv source venv/bin/activate pip install torch==2.0.1a0 torchvision==0.15.2a0 intel-extension-for-pytorch==2.0.120+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl-aitools/ pip install -r requirements.txt
For the second start and beyond, venv needs to be reactivated:
source venv/bin/activate
Set oneAPI vars:
source /opt/intel/oneapi/setvars.sh
Running ComfyUI (via
python
):Running ComfyUI (via
ipexrun
):Beta Was this translation helpful? Give feedback.
All reactions