Intel Arc Graphics Thread #476
Replies: 52 comments 139 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.
-
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.
-
So i just installed ComfyUI with IPEX support on my asus nuc 14 pro, intel core ultra 7 155H with 96GB ram, i was getting the torchvision error but it seemed to be working anyways. Windows 11 Pro using miniconda, python3.11 env I just found this: running that before installing torch, torchvision etc. totally got rid of the torchvision unable to load module re: image.pyd i'm going to try running with the --disable-ipex-optimize flag to clean up the last of the warnings it's giving during inference. currently i can generate up to 1024x1024 with no problems tested SD1.5, SDXL, and Flux so far going to try some video gens soon and will post again |
Beta Was this translation helpful? Give feedback.
-
pip list: accelerate 1.2.0 |
Beta Was this translation helpful? Give feedback.
-
conda list: |
Beta Was this translation helpful? Give feedback.
-
Here is my run output for a basic Flux gen, 1368x768. my prompt is too long causing a warning but there is also a NumPy array not writable warning: (comfyui) PS C:\ComfyUI> python main.py --disable-ipex-optimize ComfyUI-Manager: installing dependencies done.** ComfyUI startup time: 2024-12-12 12:09:38.217188 Prestartup times for custom nodes: Total VRAM 51911 MB, total RAM 97725 MB Loading: ComfyUI-Impact-Pack (V8.0.1)[Impact Pack] Wildcards loading done. Loading: ComfyUI-Manager (V2.55.4)ComfyUI Version: v0.3.7-14-g7a7efe8 | Released on '2024-12-11'[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
|
Beta Was this translation helpful? Give feedback.
-
Nice problem solving skills if you got AI image generation to work locally on your machine. I finally got Flux working after weeks of experimenting with dead end instructions all over the web, as well as after obtaining a new laptop with a better video card (RTX 3060 6GB). I ended up asking ChatGPT the best way to create AI generated images and it got me setup with Forge/InvokeAI, however the software didn't quite work out of the box. I had to find a checkpoint that wouldn't cause my card to error out and so far that's only been the flux1-schnell-q2_k.gguf, flux1-dev-q2.gguf, and v1-5-pruned-emaonly.safetensors checkpoints. All in all, AI image generation is incredibly complicated and is a major hassle trying to generate your own AI images, but I did find a solution that works. If you've got a newer video card with 6+ GB of RAM, asking ChatGPT for instructions on how to install Forge/InvokeAI using the aforementioned checkpoints might be a possible solution for you too. It also may be easier to just buy a subscription or use a free AI image generation site online than trying to set it up yourself as it's tremendously convoluted and the software and technology involves a steep learning curve. Good luck. |
Beta Was this translation helpful? Give feedback.
-
I Drafted my installation procedures, should be alot easier to follow than what i was following when i set it up last night: Installing ComfyUI on Windows 11 using Intel GPU Step 1: Install the latest drivers for your intel devices.
Step 2: Install Intel oneAPI basekit:
Step 3: Setup Python Environment:
Step 4: Clone the ComfyUI repository:
Step 5: Activate conda env:
Step 6: Install ComfyUI dependencies:
Step 7: Remove the "standard" torch libraries (intel-extension-for-pytorch may not be installed but included for good measure):
Step 8: Install the IPEX torch libraries and dependencies:
Step 9: Close miniconda3 terminal Optional Steps: Step 10: Create batch file to launch ComfyUI (notepad or VScode etc. whatever works) in ComfyUI main directory:
Step 11: Right click "start_comfyui.bat" > send to desktop (create shortcut). Step 12: Right click "start_comfyui.bat - Shortcut" > Rename > ComfyUI edit: added missing ".txt" in step 6 ... (FYI the latest ipex 2.5.1 xpu is a pretty simple install compared to this) |
Beta Was this translation helpful? Give feedback.
-
Just to update i have been able to push flux generation up to 2048x1024 ... 60-70s/it at 6 steps with schnell so 6 or 7 mins. 28.1 GB used of shared VRAM, 41.1 GB total RAM. |
Beta Was this translation helpful? Give feedback.
-
Hello I have Comfy working just fine with a single GPU. I had a 750 and just put in a 770 and both worked individually installed. To be very clear I don't want to use both at the same time I want to be able to select the 770 for jobs and just use the 750 for my displays etc. but I cannot for the life of me figure out how to force it to use the 770 (id 0) as it just defaults to the 750 (id 1) no matter what I do. I tried using the standard modifications to the .bat file and to the cli_args file but I am assuming it's looking at something in the cenv directory since it's Intel based on the behavior. When I change (or add) the --cuda-device default settings it will show that it's using the device I forced but still just uses the 750. Anyone have any ideas on where I can go to force it to use the 770 (id 0)? Thanks in advance!!! |
Beta Was this translation helpful? Give feedback.
-
There is a new version of IPEX for XPU, v2.5.10+xpu, released 8 hours ago. |
Beta Was this translation helpful? Give feedback.
-
Updated to v2.5.10+xpu, seems like it takes up more shared vrams than 2.3.110.post0+xpu. Total vram used increased from 14+GB to 18+GB |
Beta Was this translation helpful? Give feedback.
-
For me it varies....I have 16G card and 32G of RAM. Once the model is
loaded it runs from 3-6 minutes for 512x512. I haven't done much with 1024.
…On Thu, Dec 19, 2024 at 3:20 PM rifux ***@***.***> wrote:
Can I ask what are the speeds for SDXL 1024x1024 on your card? Just
curious.
—
Reply to this email directly, view it on GitHub
<#476 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNYG66EPZXH5HJQSW74G5IL2GM2B3AVCNFSM6AAAAAAWZ5LOZKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRSGIYTONY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
does not work for me for some reason...
|
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