Closed FalxGod closed 1 year ago
When I added these 3 paths to my environment variables the source installer finally started working.
%SystemRoot%\system32 %SystemRoot% %SystemRoot%\System32\Wbem
also, make sure to check the paths in the small config file called .invokeai in the "user/'my_name'" folder. It seems to override your choices unless you edit the file. 1
When I added these 3 paths to my environment variables the source installer finally started working.
%SystemRoot%\system32 %SystemRoot% %SystemRoot%\System32\Wbem
also, make sure to check the paths in the small config file called .invokeai in the "user/'my_name'" folder. It seems to override your choices unless you edit the file. 1
I think you posted in the wrong thread? The installer works fine for me. And my .invokeai file doesn't cause any problems.
@FalxGod Yes known issue with using CPU instead of GPU. Discord link with ideas of doing the manual install, and updating pytorch. https://discord.com/channels/1020123559063990373/1047568895168483348 InvokeAI 2.0.2 was using GPU and then switched to 2.0 and now uses CPU. So whatever changed in the version or if in that time pytorch made 11.6 the latest version? As of this post now known fix. Thread with more info on how to check/ install pytorch version: https://github.com/invoke-ai/InvokeAI/discussions/1628#discussioncomment-4277763
@FalxGod pytorch doesnt work with python 3.11 and python doesn't like being deleted. Have to manually ctr+f 'python' in reg edit. Shows one entry delete then ctr+f again to find next.
here's from a clean install of python 3.10.8 pip install numpy
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116
pip install virtualenv
virtualenv invokeai
cd c:/ to invokeAI folder (easiest way is to find invokeAI folder and right click the top address and copy) in cmd type cd ctr+v
copy environments-and-requirements\requirements-win-colab-cuda.txt requirements.txt
pip install --prefer-binary -r requirements.txt
python scripts/invoke.py --web
@cybromancy Ty I will look into it! Imma leave the issue open for now.
Still no luck here then :/ Damn.... I think this should be one of the main issues to look at. How many want to sun sirapy slow on a CPU when they can gp lightning fast on a GPU?!
I am having the same issue. RTX 3080 Ti. Its using CPU instead of GPU. This is from a fresh automated install.
Yeah I’m not going to even bother trying at this point.
Still no luck here then :/ Damn.... I think this should be one of the main issues to look at. How many want to sun sirapy slow on a CPU when they can gp lightning fast on a GPU?!
It is 100% the main issue. I wish I’d never come across this app tbh it’s been nothing but a tease and a headache.
EASY FIX:
- torchvision=0.13.1+cu116
- torchaudio=0.12.1+cu116
- pytorch=1.12.1+cu116
did all that and it still says CPU [image: image.png]
On Mon, Dec 5, 2022 at 1:40 PM Falxie @.***> wrote:
EASY FIX:
Open enviroment.yml
change line 9,10,11 to
- torchvision=0.13.1+cu116
- torchaudio=0.12.1+cu116
- pytorch=1.12.1+cu116
run install.bat
run invoke.bat [image: grafik] https://user-images.githubusercontent.com/39287404/205738730-f7b58c87-b5b9-4d1b-a242-47da3ba1d3ab.png Running cuda now
— Reply to this email directly, view it on GitHub https://github.com/invoke-ai/InvokeAI/issues/1763#issuecomment-1338136720, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BHMCA2XIHTD7NIUNOYEW3WLZHNNANCNFSM6AAAAAASS4ZXEU . You are receiving this because you commented.Message ID: @.***>
somehow it revered that yml file back... ill try again.
On Mon, Dec 5, 2022 at 2:30 PM Echo T @.***> wrote:
did all that and it still says CPU [image: image.png]
On Mon, Dec 5, 2022 at 1:40 PM Falxie @.***> wrote:
EASY FIX:
Open enviroment.yml
change line 9,10,11 to
- torchvision=0.13.1+cu116
- torchaudio=0.12.1+cu116
- pytorch=1.12.1+cu116
run install.bat
run invoke.bat [image: grafik] https://user-images.githubusercontent.com/39287404/205738730-f7b58c87-b5b9-4d1b-a242-47da3ba1d3ab.png Running cuda now
— Reply to this email directly, view it on GitHub https://github.com/invoke-ai/InvokeAI/issues/1763#issuecomment-1338136720, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BHMCA2XIHTD7NIUNOYEW3WLZHNNANCNFSM6AAAAAASS4ZXEU . You are receiving this because you commented.Message ID: @.***>
so when I run the install.bat after making the changes to the yml file, it redownloads the file, removing the changes i just made.
On Mon, Dec 5, 2022 at 2:32 PM Echo T @.***> wrote:
somehow it revered that yml file back... ill try again.
On Mon, Dec 5, 2022 at 2:30 PM Echo T @.***> wrote:
did all that and it still says CPU [image: image.png]
On Mon, Dec 5, 2022 at 1:40 PM Falxie @.***> wrote:
EASY FIX:
Open enviroment.yml
change line 9,10,11 to
- torchvision=0.13.1+cu116
- torchaudio=0.12.1+cu116
- pytorch=1.12.1+cu116
run install.bat
run invoke.bat [image: grafik] https://user-images.githubusercontent.com/39287404/205738730-f7b58c87-b5b9-4d1b-a242-47da3ba1d3ab.png Running cuda now
— Reply to this email directly, view it on GitHub https://github.com/invoke-ai/InvokeAI/issues/1763#issuecomment-1338136720, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BHMCA2XIHTD7NIUNOYEW3WLZHNNANCNFSM6AAAAAASS4ZXEU . You are receiving this because you commented.Message ID: @.***>
I changed the file to read only so it could not replace the file, but this is what it shows. [image: image.png]
On Mon, Dec 5, 2022 at 2:38 PM Echo T @.***> wrote:
so when I run the install.bat after making the changes to the yml file, it redownloads the file, removing the changes i just made.
On Mon, Dec 5, 2022 at 2:32 PM Echo T @.***> wrote:
somehow it revered that yml file back... ill try again.
On Mon, Dec 5, 2022 at 2:30 PM Echo T @.***> wrote:
did all that and it still says CPU [image: image.png]
On Mon, Dec 5, 2022 at 1:40 PM Falxie @.***> wrote:
EASY FIX:
Open enviroment.yml
change line 9,10,11 to
- torchvision=0.13.1+cu116
- torchaudio=0.12.1+cu116
- pytorch=1.12.1+cu116
run install.bat
run invoke.bat [image: grafik] https://user-images.githubusercontent.com/39287404/205738730-f7b58c87-b5b9-4d1b-a242-47da3ba1d3ab.png Running cuda now
— Reply to this email directly, view it on GitHub https://github.com/invoke-ai/InvokeAI/issues/1763#issuecomment-1338136720, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BHMCA2XIHTD7NIUNOYEW3WLZHNNANCNFSM6AAAAAASS4ZXEU . You are receiving this because you commented.Message ID: @.***>
another thing, in the file its not line 9,10,11. its 10,11,12.
[image: image.png]
On Mon, Dec 5, 2022 at 2:40 PM Echo T @.***> wrote:
I changed the file to read only so it could not replace the file, but this is what it shows. [image: image.png]
On Mon, Dec 5, 2022 at 2:38 PM Echo T @.***> wrote:
so when I run the install.bat after making the changes to the yml file, it redownloads the file, removing the changes i just made.
On Mon, Dec 5, 2022 at 2:32 PM Echo T @.***> wrote:
somehow it revered that yml file back... ill try again.
On Mon, Dec 5, 2022 at 2:30 PM Echo T @.***> wrote:
did all that and it still says CPU [image: image.png]
On Mon, Dec 5, 2022 at 1:40 PM Falxie @.***> wrote:
EASY FIX:
Open enviroment.yml
change line 9,10,11 to
- torchvision=0.13.1+cu116
- torchaudio=0.12.1+cu116
- pytorch=1.12.1+cu116
run install.bat
run invoke.bat [image: grafik] https://user-images.githubusercontent.com/39287404/205738730-f7b58c87-b5b9-4d1b-a242-47da3ba1d3ab.png Running cuda now
— Reply to this email directly, view it on GitHub https://github.com/invoke-ai/InvokeAI/issues/1763#issuecomment-1338136720, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3BHMCA2XIHTD7NIUNOYEW3WLZHNNANCNFSM6AAAAAASS4ZXEU . You are receiving this because you commented.Message ID: @.***>
Here's what I have done in total before it worked for me (excerpt from discord): I also deleted the C.\Users[username].invokeai file before running install.bat and invoke.bat (after editing the lines; which I just realized by reading your comment and another in the github issue did nothing because it gets overwritten by running install.bat)
Im doubtful it will help, because the .invoke file says nothing about cuda...
I also did some steps from the manual install but not all. I ran:
Then I deleted the whole folder again. (Because I got lazy~~) After that I ran these 2 commands in my cmd:
After that i edited the 3 lines in the enviroment.yml and it worked
Yeah that didn't work (W10)
2. pip install torch==1.12.1+cu116
That didn't work either
@Kallamamran what version of Python do you have installed? edit: If you have Python 11 then uninstall it and get python 10.x. PyTorch is not supported in version 11 of Python at the moment. (Had the same error when using Python 11)
I Have installed invokeai 2.5.5 Completely Without error Now when i start invokeai.bat This appears
When you are looking at the Windows performance monitor, make sure you've expanded the details and changed one of the graphs to Cuda
. The default load % shown could be for the 3D
pipeline, not Cuda.
So when you're looking at if a patch worked or not, you want to see the Cuda
load percentage, like in this example from my Windows 10 machine:
@VimCommando When you start InvokeAI, Is one of the first lines >> Patchmatch initialized
?
I am just currious, since I have the feeling that the precompiled dll for windows is only compiled with CPU Features. But this should of course not stop the other Modules from accessing the GPU (which is why it would be great if you have Patchmatch initialized 😅)
EDIT:
Just saw that we already have prove that patchmatch does not block the use of cuda:
Plot twist: my above statement is only true if hardware accelerated GPU scheduling is not enabled: https://devblogs.microsoft.com/directx/hardware-accelerated-gpu-scheduling/
Once you turn this on, then CUDA is no longer a separate category for the performance monitor, and the load reflects in the main utilization graph as expected.
I discovered this after upgrading my graphics card and trying to get a completely unrelated program running.
I fixed it with:
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html
(while in the environment)
You can check if cuda is working with:
$ python
Python 3.9.16 (main, Jan 11 2023, 16:16:36) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
After that, I directly ran invoke.py
.
I fixed it with:
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html
(while in the environment)
You can check if cuda is working with:
$ python Python 3.9.16 (main, Jan 11 2023, 16:16:36) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import torch >>> torch.cuda.is_available() True
After that, I directly ran
invoke.py
.Yup this worked for me!!. i used invoke.bat
The above fix didn't work for me but this similar one did: https://github.com/invoke-ai/InvokeAI/issues/2460#issuecomment-1416056021
Is there an existing issue for this?
OS
Windows
GPU
cuda
VRAM
24GB
What happened?
Starting invoke.bat is always saying that it uses the CPU instead of my GPU (And it indeed tries to generate with the CPU). Here's the cmd output with the relevant line indicated by an arrow. The line should read ">> Using device_type cuda" not "CPU"
Screenshots
Here's a screenshot of a prompt being executed. Notice the time to completion in the bottom right corner, And this is my GPU during the generation process. Notice the utilization which also indicates that the process uses the CPU.
Additional context
I reinstalled InvokeAI several times and it's always the same. Automatic1111 WebUI uses the GPU just fine.
Contact Details
No response