SUPIR icon indicating copy to clipboard operation
SUPIR copied to clipboard

Question about CUDA Error

Open a3nima opened this issue 1 year ago • 6 comments

System: Windows 10, Nvidia 3090 24GB VRAM

Installed supir in a separate environment.

PATH for CUDA is set in my system.

Error:

File "D:\SUPIR\gradio_demo.py", line 40, in raise ValueError('Currently support CUDA only.') ValueError: Currently support CUDA only.

installed packages:

(d:\supir) D:\SUPIR>pip list Package Version


aiofiles 23.2.1 aiohttp 3.9.3 aiosignal 1.3.1 altair 5.2.0 annotated-types 0.6.0 antlr4-python3-runtime 4.9.3 anyio 4.3.0 async-timeout 4.0.3 attrs 23.2.0 boto3 1.34.55 botocore 1.34.55 cachetools 5.3.3 certifi 2024.2.2 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 colorama 0.4.6 contourpy 1.2.0 cycler 0.12.1 einops 0.7.0 eval-type-backport 0.1.3 exceptiongroup 1.2.0 fastapi 0.110.0 ffmpy 0.3.2 filelock 3.13.1 fonttools 4.49.0 frozenlist 1.4.1 fsspec 2024.2.0 ftfy 6.1.3 google-api-core 2.17.1 google-api-python-client 2.120.0 google-auth 2.28.1 google-auth-httplib2 0.2.0 googleapis-common-protos 1.62.0 gradio 4.19.2 gradio_client 0.10.1 gradio_imageslider 0.0.18 h11 0.14.0 httpcore 1.0.4 httplib2 0.22.0 httpx 0.27.0 huggingface-hub 0.21.3 idna 3.6 importlib_resources 6.1.2 Jinja2 3.1.3 jmespath 1.0.1 jsonschema 4.21.1 jsonschema-specifications 2023.12.1 kiwisolver 1.4.5 kornia 0.7.1 lightning-utilities 0.10.1 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.8.3 mdurl 0.1.2 mpmath 1.3.0 multidict 6.0.5 networkx 3.2.1 numpy 1.26.4 omegaconf 2.3.0 open-clip-torch 2.24.0 opencv-python 4.9.0.80 orjson 3.9.15 outcome 1.3.0.post0 packaging 23.2 pandas 2.2.1 pillow 10.2.0 pip 23.3.1 protobuf 4.25.3 pyasn1 0.5.1 pyasn1-modules 0.3.0 pycparser 2.21 pydantic 2.6.3 pydantic_core 2.16.3 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 PySocks 1.7.1 python-dateutil 2.9.0.post0 python-magic 0.4.27 python-multipart 0.0.9 pytorch-lightning 2.2.1 pytz 2024.1 PyYAML 6.0.1 referencing 0.33.0 regex 2023.12.25 requests 2.31.0 rich 13.7.1 rpds-py 0.18.0 rsa 4.9 ruff 0.3.0 s3transfer 0.10.0 safetensors 0.4.2 scipy 1.12.0 selenium 4.18.1 semantic-version 2.10.0 sentencepiece 0.2.0 setuptools 68.2.2 shellingham 1.5.4 six 1.16.0 skipy 0.1.2 sniffio 1.3.1 sortedcontainers 2.4.0 starlette 0.36.3 sympy 1.12 timm 0.9.16 tokenizers 0.13.3 tomlkit 0.12.0 toolz 0.12.1 torch 2.2.1 torchmetrics 1.3.1 torchvision 0.17.1 tqdm 4.66.2 transformers 4.28.1 trio 0.24.0 trio-websocket 0.11.1 typer 0.9.0 typing_extensions 4.10.0 tzdata 2024.1 uritemplate 4.1.1 urllib3 1.26.18 uvicorn 0.27.1 wcwidth 0.2.13 websockets 11.0.3 wheel 0.41.2 wsproto 1.2.0 yarl 1.9.4 zipp 3.17.0

a3nima avatar Mar 05 '24 19:03 a3nima

Hello, print torch.cuda.device_count() first. In your case, it should be 1, and now it returns zero.

Fanghua-Yu avatar Mar 07 '24 06:03 Fanghua-Yu

Yes it returns "0"..

(d:\supir) D:\SUPIR>echo %CUDA_PATH% C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8

Can you give me a hint, what I can do ?

this is how I ran the gradio_demo.py: (d:\supir) D:\SUPIR>python gradio_demo.py --use_tile_vae --no_llava --use_image_slider --loading_half_params

a3nima avatar Mar 07 '24 11:03 a3nima

通常是因为执行 pip install -r requirements.txt时,安装的是cpu版本,你应该卸载cpu版本,然后安装gpu版本 Usually because you install the cpu version when you execute pip install-r requirements.txt, you should uninstall the cpu version and then install the gpu version

print(torch.cuda.is_available()) print(torch.version)

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

ifredom avatar Mar 15 '24 08:03 ifredom

where do I find the correct version / requirements.txt to fully install the program in its own environment with GPU?

a3nima avatar Mar 15 '24 13:03 a3nima