xformers installation for RTX 4090 on linux #111
Replies: 4 comments 4 replies
-
i faced this error too |
Beta Was this translation helpful? Give feedback.
-
Followed your instructions. I have a 3090, just skipped step 2. Seems to have worked. I ran the instructions from within the sd-scripts folder. I was able to follow the windows instructions well enough to install kohya, got your xformers to install, then there's this: cp .\bitsandbytes_windows*.dll .\venv\Lib\site-packages\bitsandbytes accelerate config hope that last bit isn't terribly important... |
Beta Was this translation helpful? Give feedback.
-
@cyber-meow How did you install kohya on Linux? Did you face any other problems, other than xformers? |
Beta Was this translation helpful? Give feedback.
-
Thanks! I have tried so many other methods, and yours is the only one that works. BTW, I recommend you to use |
Beta Was this translation helpful? Give feedback.
-
I finally get this work but it took me so long time so I decide it to share it here in case others also need it.
Better solutions may exist and I would like to learn about it.
The instruction in the repository is only for windows and I cannot get any existing linux wheel work, so I compile xformers on my own in the following way
1. Get cuda 11.8
Older version does not support RTX 4090. Cuda 12.0 throws version mismatch error.
2. Modify
torch/utils/cpp_extension.py
Add
('Lovelace', '8.9+PTX')
innamed_arches
and changesupported_arches
tosupported_arches = ['3.5', '3.7', '5.0', '5.2', '5.3', '6.0', '6.1', '6.2', '7.0', '7.2', '7.5', '8.0', '8.6', '8.9']
3. Compile xformers 0.0.15
That's it. For Lora training I can get 150 images x 10 epochs done in 1.5 minutes at batch size 10 (it uses around 19G of vram and the speed is ~1.5it/s).
Edit
The cudnn trick works for training as well. I didn't test it on kohya trainer but it accelerates significantly my training with Everydream2. I just point
LD_LIBRARY_PATH
to the folder of new cudnn files and delete the corresponding ones from the original environment.Other solutions that I have tried:
pip install xformers==0.0.16rc425
as inAUTOMATIC1111/stable-diffusion-webui
: it runs but loss goes to nanpip install -U -I --no-deps https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/linux/xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl
: this seems to be the linux equivalence of the suggested wheel, but I getRuntimeError: No such operator xformers::efficient_attention_forward_cutlass - did you forget to build xformers with python setup.py develop?
conda install -c xformers/label/dev xformers
: errorxFormers wasn't built with CUDA support
Beta Was this translation helpful? Give feedback.
All reactions