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 support #65

Closed
brcisna opened this issue Sep 3, 2024 Discussed in #2 · 16 comments
Closed

GPU support #65

brcisna opened this issue Sep 3, 2024 Discussed in #2 · 16 comments

Comments

@brcisna
Copy link

brcisna commented Sep 3, 2024

Hi,

Am not clear on the CE version of Wunjo AI V2 if GPU support exists ( on Linux Debian ) ?
Maybe it is for Nvidia cards?
Have an Amd Pro W6600 GPU card and it is never being utiliazed in Wunjo AI V2

TIA

@wladradchenko
Copy link
Owner

Hi. In order to use GPU, you need to have card of Nvidia, because of using CUDA. You can find this information in wiki or wunjo.online.

But, you can try to use alternative for AMD cards ZLUDA. I didn't use ZLUDA before, but maybe this will help you.

Switch before GPU and CPU did if torch cuda exists, you need to do torch.cuda.is_available be true with ZLUDA for AMD card.

@brcisna
Copy link
Author

brcisna commented Sep 3, 2024

Thank You wladrachenko,

Have never heard of ZLUDA... I do have ROCm working on a Debian 12 install. Was quite a challenge to be honest.
Everything from AMD is kind of packaged towards Ubuntu,,which is based on Debian,,,but many things ends up being different between the two distors,,in the end.
I will try and setup ZLUDA,,,,and report,,if i can get GPU utilization on a recent AMD Pro W6600 card.

Thanks again

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

@wladradchenko

Just wanted to follow up.
I was able to get ZLUDA to work with my AMD Pro W6600 card in ComfyUI,,,but cannot get the card to be utilized with your Wunjo V2 App.
Would like to get this card to work using Wunjo V2.

Any ideas,,,how to launch Wunjo to see the ZLUDA/AMD/torch setup.
I am really out to lunch on this,,even though have tried to read through how this all ties together.

Worth noteing ,utilizing ZLUDA really speeds up ComfyUI under the hood somehow.

Thanks,
Barrry

@wladradchenko
Copy link
Owner

I don't have AMD card to test this. I think maybe this relate to pip install requirements process of specific version torch. Because of briefcase package import version of torch in lib for CUDA and maybe this difference with ZLUDA.

I would recommend you run Wunjo CE by briefcase dev from code. You can use this video how run the app or wiki chapter how build gpu version.

Also you can open requirements for ComfyUI and watch what's versions of torch using and additional libs, maybe to there specific version. You need to update versions and add new in pyproject.toml before run.

I think will be amazing for other users of on YouTube will be video how run Wunjo and AMD with ZLUDA.

@wladradchenko
Copy link
Owner

wladradchenko commented Sep 15, 2024

In ComfyUI README I see this text:

AMD GPUs (Linux only)
AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1

This is the command to install the nightly with ROCm 6.2 which might have some performance improvements:

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2

You can add https://download.pytorch.org/whl/nightly/rocm6.2 in Wunjo requirements and pyproject.toml and try to run. If this will work please tell me, I will add logical in code.

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

@wladradchenko
Would like to try this.
Give me more detailed instrutcions on how to add... to pyrpoject.toml
What section do i add to to build breifcase dev with this installed.
Give me example,,,so i can copy/paste and what section in the pyproject.toml

I did do manual install for the pip command for ROCM6.2 and that went ok. in my wunjo venv

TIA

@wladradchenko
Copy link
Owner

wladradchenko commented Sep 15, 2024

@brcisna pyproject.toml need to change if you wanna use briefcase build, simple pip install will work for briefcase dev.

Anyway, if you wanna do build, you need to for Windows change lines 149-151
, you need to change on links https://download.pytorch.org/whl/nightly/rocm6.2/torch/torch-2.5.0.dev20240823+rocm6.2-cp310-cp310-linux_x86_64.whl, https://download.pytorch.org/whl/nightly/rocm6.2/torchaudio/torchaudio-2.5.0.dev20240915+rocm6.2-cp310-cp310-linux_x86_64.whl,https://download.pytorch.org/whl/nightly/rocm6.2/torchvision-0.20.0.dev20240824%2Brocm6.2-cp310-cp310-linux_x86_64.whl. You can see important versions, what you need to use torch and torchaudio similar versions, and all is for python3.10. For Linux (also for Windows will work too) you can copy from venv to lib folders torch, torchvision and torchaudio how was wrote in documentation.

When you change pyproject_gpu.toml, you need to rename this on pyproject.toml and after you can use do briefcase build to run app from exe.

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

@wladradchenko

Two things

  1. i am seeing these errors in the console
    ` Failed to read portal version property
    [103579:103579:0915/133522.924275:ERROR:angle_platform_impl.cc(44)] Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Unsupported GLX version (requires at least 1.3).
    ERR: Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Unsupported GLX version (requires at least 1.3).
    [103579:103579:0915/133522.924967:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Unsupported GLX version (requires at least 1.3).
    [103579:103579:0915/133522.925098:ERROR:gl_display.cc(767)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
    [103579:103579:0915/133522.925975:ERROR:angle_platform_impl.cc(44)] Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Unsupported GLX version (requires at least 1.3).
    ERR: Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Unsupported GLX version (requires at least 1.3).
    [103579:103579:0915/133522.926128:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Unsupported GLX version (requires at least 1.3).
    [103579:103579:0915/133522.926252:ERROR:gl_display.cc(767)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED

2, I have a fairly new AMD card. In the documentaion for my particular card i have to add the following to launch comfui,,,otherwise i get errors.
(There is also another variant of the below workaround,, for another version number of AMD cards if you look on ComfyUI-Zulda setup aslo)

HSA_OVERRIDE_GFX_VERSION=10.3.0 python main.py

I am guessing i need something similar added to launch Wunjo.
Once this prefix is added to the ComfyUI launch script,,,there are no errors,,and ZLUDA does seem to work,,as i am seeing heavy usage by the AMD card in ComfyUI.
Hope this makes sense.

Barry

@wladradchenko
Copy link
Owner

wladradchenko commented Sep 15, 2024

@brcisna I suggest that you need to add in app.py the line 11: os.environ['HSA_OVERRIDE_GFX_VERSION']=10.3.0 . But in main.py I don't see something with HSA_OVERRIDE_GFX_VERSION.

How do you run ComfyUI Zluda? If you run bat file, I see interest line .\zluda\zluda.exe -- %PYTHON% main.py %COMMANDLINE_ARGS% where PYTHON=%~dp0/venv/Scripts/python.exe. You can try to do .\zluda\zluda.exe --absolute_path/wunjo/venv/Scripts/python.exe briefcase dev from folder portable.

@wladradchenko
Copy link
Owner

wladradchenko commented Sep 15, 2024

Also I think you can try to run file from ComfyUI Zludo in Wunjo folder near venv. This file.

For experiment, if the above didn't help you, you can run installer bat from ComfyUI Zludo in Wunjo project folder near venv folder. Because of I see lines:

Set "VIRTUAL_ENV=venv"
If Not Exist "%VIRTUAL_ENV%\Scripts\activate.bat" (
    python.exe -m venv %VIRTUAL_ENV%
)

This will be also install and chande specific parameters for torch Zluda as in ComfyUI in Wunjo for Windows.

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

@wladradchenko

I am very sorry...I didnt mention,,I ONLY do Linux.... no Windows involved here...
Ill look at the I suggest that you need to add in app.py the line 11: os.environ['HSA_OVERRIDE_GFX_VERSION']=10.3.0 . But in main.py I don't see something with HSA_OVERRIDE_GFX_VERSION.

to run ComfyUI i cearted the following script. ( regularly I would just run,,, 'python main.py')
But that throws error when launched with Zluda,,,installed,,This is a know error,,for late generation AMD cards...My card is an AMD Pro W6600
So the documentaion says to change the lauch script,,,,,which i made an .sh script for convience.:

HSA_OVERRIDE_GFX_VERSION=10.3.0 python main.py

This works without erros,,,for my Pro W6600 card.

these cards have some of the paletst,,,ray tracing,,,features,,etc.,,,I dont have a clue how this all ties together.

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

@wladradchenko

I apologize..

In comfyui,zluda,,, I do not even see an app.py????

I do see the main.py,,,

@wladradchenko
Copy link
Owner

wladradchenko commented Sep 15, 2024

@brcisna app.py is file of Wunjo. You can use os.envitoment or in shell script use HSA_OVERRIDE_GFX_VERSION=10.3.0, those will be similar.

If after all that has been done for Linux, the application still does not start on AMD, then I do not know what is missing. Perhaps you can contact the repository with a discussion https://github.com/patientx/ComfyUI-Zluda or https://github.com/comfyanonymous/ComfyUI how they have been solved similar trouble with Zluda.

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

os.environ['HSA_OVERRIDE_GFX_VERSION']=10.3.0
^^
SyntaxError: invalid syntax

Problem running app wunjo.

@brcisna
Copy link
Author

brcisna commented Sep 15, 2024

@wladradchenko

OK,,,my mistake,,, the GL errors was due to the remote desktop client i was remoting into my,,,linux machine in basement..
After using Anydesk remote desktop,,am not getting any errors in the console now!!

Am certain,,, Zluda,,,and my GPU is being used now,,, launching ith the HSA_OVERRIDE_GFX_VERSION=10.3.0,

I would like to try and streamline this i put this in the app.py as you suggested but,,i get syntax errors.
Let me do some more testing,,,,to get some good screen captures.

Keep in mind my GPU is AMD Radeon Pro W6600,,only 8GB of GDRR6 VRAM just for completness..
This is a fairly new generation card with most of the latest features.
I can generate face swaps,,instantly now,,,even with 1280 res photos.!

@wladradchenko
Copy link
Owner

@brcisna If you want to increase the resolution that the Wunjo gets in output, you can go to the settings page. By default, it is HD.

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

2 participants