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

Forcing Torch Version to 1.13.1 for RX 5000 series GPUs #11048

Merged
merged 6 commits into from
Jun 9, 2023

Conversation

DGdev91
Copy link
Contributor

@DGdev91 DGdev91 commented Jun 5, 2023

Description

As described on the discussion under #10465, this is an attempt to make work the WebUI again on older AMD cards like the RX5000 series.

The code forces TORCH_COMMAND for Navi and Renoir GPUs.

Also, the older pytorch version requires python version <= 3.10. I added some code to check it, so the user gets a cleaner error message when trying to run it on python 3.11 or later

This is still intended as a workaround, to be removed as soon as someone finds a way to run the webui properly on these cards.

Should fix #10873

Checklist:

@GhostNaN
Copy link

GhostNaN commented Jun 6, 2023

Why do you want to force the TORCH_COMMAND for Navi 2 cards if your issue is with Navi 1?
Also, I've had zero issues with running torch>= 2.0 with rocm 5.4.2 and python >= 3.11 on an RX 6700 XT as long as HSA_OVERRIDE_GFX_VERSION=10.3.0 is specified.

@AUTOMATIC1111
Copy link
Owner

Use python_cmd env var for python and also I would prefer if there wasn't same code copied twice and if running python to get version wasn't done until it's needed.

@DGdev91 DGdev91 changed the title Forcing Torch Version to 1.13.1 for Navi and Renoir GPUs Forcing Torch Version to 1.13.1 for Navi 1 (RX 5000 series) GPUs Jun 6, 2023
@DGdev91
Copy link
Contributor Author

DGdev91 commented Jun 6, 2023

Ok, i was thinking the HSA_OVERRIDE_GFX_VERSION was causing the issue, but there's must be something else going on.
Now i'm applying the code only for Navi1 and using python_cmd as suggested.

@DGdev91 DGdev91 changed the title Forcing Torch Version to 1.13.1 for Navi 1 (RX 5000 series) GPUs Forcing Torch Version to 1.13.1 for RX 5000 series GPUs Jun 6, 2023
@AUTOMATIC1111
Copy link
Owner

AUTOMATIC1111 commented Jun 7, 2023

Any more feedback from AMD users?

@cyatarow
Copy link

cyatarow commented Jun 7, 2023

I'm the author of #10855.
Out of curiosity, why is RX 5000 series that incompatible with torch 2.0?

@DGdev91
Copy link
Contributor Author

DGdev91 commented Jun 7, 2023

I'm the author of #10855. Out of curiosity, why is RX 5000 series that incompatible with torch 2.0?

That's a good question. My first guess is that HSA_OVERRIDE_GFX_VERSION was causing problems, but that's also true for RX 6000, wich is working just fine.

Sooo.... Who knows.

We can't even be really sure it's just RX 5000, maybe there are other series wich have problems but no one has reported it yet

@GabrielDTB
Copy link

RX 5700 user here. Arch Linux with ROCm 5.4.3. CPU generation worked fine but when using the GPU, generation would make 0 progress. CLI output gave nothing and the webui reported rightfully that nothing was happening. Radeontop would report Shader Interpolator pegged at 100%, Memory Clock would fluctuate between 0 and 100%, and Shader Clock would be pegged at 100%. VRAM at ~4500M with Stable Diffusion 1.5 iirc. Attempting to switch Stable Diffusion checkpoint through the webui would tick up indefinitely with an expected time of 1.5s on bottom.

Changing to Python 3.10.12 and applying this patch makes everything functional. Small note: I don't have bc installed, so I had to cut out the check for whether Python 3.10 or else install it. There's probably a more portable solution.

@AUTOMATIC1111 AUTOMATIC1111 merged commit 741bd71 into AUTOMATIC1111:dev Jun 9, 2023
@cyatarow
Copy link

But...is there really no way to work around the issue other than fixing torch to 1.13.1?
Could it be that since RDNA1 is not officially supported by ROCm, torch 2.0 was developed without any consideration of RDNA1??

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

Successfully merging this pull request may close these issues.

6 participants