Skip to content
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

GPU not getting detected #19

Open
Charonum opened this issue Dec 2, 2022 · 13 comments
Open

GPU not getting detected #19

Charonum opened this issue Dec 2, 2022 · 13 comments

Comments

@Charonum
Copy link

Charonum commented Dec 2, 2022

Hi, I stumbled upon this a couple of minutes ago and got everything set up, but...
[controller] >>> configuration file 'config.txt' doesn't exist; using defaults... [controller] >>> starting webserver (http://localhost) as a background process... [controller] >>> detected 0 total GPU device(s)... [controller] >>> ERROR: unable to initialize any GPUs for work; exiting!
I have an Nvidia RTX 3060 Ti, why isn't dream factory finding it? Do I need to specify it somewhere?

Thanks

@Charonum Charonum changed the title GPUs not getting detected GPU not getting detected Dec 2, 2022
@Charonum
Copy link
Author

Charonum commented Dec 2, 2022

Update: I reran the setup and it can now find the config file. Still... no GPU.

@rbbrdckybk
Copy link
Owner

Copying this from another reply because it sounds like potentially the same issue:

Given that you have an Nvidia GPU and Dream Factory doesn't see it, the most likely explanation is that Pytorch wasn't installed properly. Did you see any errors when you ran setup.py?

Try running setup again with the verbose option and see if you catch any obvious errors:

python setup.py --force --shell --verbose

Alternatively, you can try installing pytorch manually:

conda install -y pandas pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

If there is a failed/leftover old installation you may need to start fresh with a new conda environment.

@Charonum
Copy link
Author

Charonum commented Dec 3, 2022

I saw that post and ran it yesterday. The setup ran correctly. When I relaunched dream factory, it still couldn't find the GPU. I also installed CUDA because I set the amount of GPUs in the config to 1 and the phrase "cuda:1" appeared.

@mkabatek
Copy link

mkabatek commented Dec 5, 2022

I saw that post and ran it yesterday. The setup ran correctly. When I relaunched dream factory, it still couldn't find the GPU. I also installed CUDA because I set the amount of GPUs in the config to 1 and the phrase "cuda:1" appeared.

cuda:1 would indicate a second GPU. cuda:0 would be a first GPU.

You can run the following command to check the number of CUDA devices

nvidia-smi

You can set the number of visible devices using the following. This would indicate you have two cuda devices.

export CUDA_VISIBLE_DEVICES=0,1

If you only have one cuda device in your system export CUDA_VISIBLE_DEVICES=0

@Charonum
Copy link
Author

Charonum commented Dec 7, 2022

I have done all of that. It still has the same error. I'm on windows, so I used set instead of export. I assume it does the same thing.

PS: Thanks for the cuda:0 suggestion. I forgot 0 counted as basically 1.

@rbbrdckybk
Copy link
Owner

If you open up an Anaconda terminal in your Dream Factory environment and run these two commands, what do you see?

pip3 show torch
nvcc --version

@Charonum
Copy link
Author

Charonum commented Dec 7, 2022

pip3 show torch:
Name: torch
Version: 1.13.0
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3
Location: c:\users\chrnm.conda\envs\dream-factory\lib\site-packages
Requires: typing_extensions
Required-by: basicsr, facexlib, gfpgan, kornia, pytorch-lightning, realesrgan, torch-fidelity, torchaudio, torchmetrics, torchvision

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:59:34_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0

@rbbrdckybk
Copy link
Owner

That looks fine to me - I'm kind of at a loss as to what could be wrong, unfortunately. I'm running DF on a 3060 Ti myself (on a Win10 machine, I also have a friend running DF on a 3060 Ti on Win11) without any problems, using exactly the steps detailed in the setup section to install things.

Does the Automatic1111 webui work on your machine (since the 12-06 release, Dream Factory requires it)?

@yggdrasil75
Copy link

I had the same issue. it appears to be something wrong with conda, I just decided to not use a virtual environment and it worked fine, detected both gpus.

@toadn2princesses
Copy link

Has this been solved or is it a start over from scratch type error, uninstall anaconda and what not and start over? I have the same above error when I try and run DF and am using a 3060ti. After running 'setup.py,' with --force or --shell I attempt to run setup-py --update and get an error stating that setup has yet to be run and to run it. I am on Ubuntu and have followed the instillation instructions as described in the readme, stable diffusion runs fine on its own and can generate images. I have tried starting a resh conda environment and get same error. pytorch version 2.1.0, cuda is installed.

@rbbrdckybk
Copy link
Owner

I'm not able to replicate these issues on any of my own environments unfortunately, but I had somebody recently comment that they needed to install PyTorch manually to get things to work properly. You can give that a try:

conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

If you're comfortable dropping Anaconda entirely you can also try running without a virtual environment.

@danieljbk
Copy link

Running into same issue: followed all instructions correctly but GPUs not detected by Dream Factory.

@danieljbk
Copy link

Local CUDA version was 12.2, fixed issue by manually installing packages as @rbbrdckybk suggested above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants