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

AMD Graphics Thread #22

Open
dboggs95 opened this issue Sep 19, 2022 · 5 comments
Open

AMD Graphics Thread #22

dboggs95 opened this issue Sep 19, 2022 · 5 comments

Comments

@dboggs95
Copy link

dboggs95 commented Sep 19, 2022

Just letting you know. I have tried and failed to run this configuration on WSL today. I have concluded that it is not possible on Windows 10.

Problem: AMD GPU on Windows 10. Dual booting Ubuntu is an option, but comes with it's own headaches, namely, the time it takes to install the OS, and the time it takes to make them play nice together so I can choose the right one at startup. I think Windows 10 is actually worse than previous OS's to do this with too. It's been a while since I've done this, but I remember getting everything all set up nice and then a few weeks later Windows 10 would just delete the other boot record. In short, AI Art should be fun, and dual booting is not fun.

Proposed and Attempted Solution: Install WSL2 with the Ubuntu 20.04 image. Install the dreadful AMD 2020 WSL preview driver, which sadly overwrites the newer driver. Then follow the steps for setup, but with the AMD version of PyTorch.

I made it over multiple hurdles, but when I finally got to the prompt step, it simply gave me the same error I get in Windows: Warning: No GPU found! Using the CPU instead. The iterations will be slow..

I kept looking for things to try, but I was forced to admit defeat after reading this and seeing the feature that would even allow me to use graphics in WSL2 is on Windows 11 (this article is geared toward GUI apps, but you can see it's showing you how to set up graphics in WSL2 here, so I believe these are one an the same issue; if I am wrong about that, maybe there's a way to do this but I'm kind of at a dead end with the information I've found, so if anybody knows anything feel free to correct me):
https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

Here are the takeaways.

You can put in the documentation that it doesn't support WSL2 for Windows 10 and save everyone the time. I can't rule out AMD graphics on Windows 11 for WSL2, and more power to somebody with a newer system who can try that combination.

Here are the notes for how I got as far as I did in case somebody wants to try it on Windows 11 using WSL2:

  1. Enable WSL and Virtual Machine Platform via Control Panel
  2. Install Ubuntu 22.04 from Windows Store.
  3. Enable Virtualization in your bios.
  4. Read here for more info on enabling graphics in WSL2: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
    • You should install the driver specified here.
    • Update WSL to WSL2 (probably should do this at the beginning so your Ubuntu image is on WSL2, although it's an easy fix if you don't).
  5. Use this command pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.1.1 to install PyTorch for AMD.
  6. Everything else is just following the same steps in this project's readme.

I'll open another issue if I get it working on Ubuntu and let everybody know any changes to the steps I took to do so.

@dboggs95
Copy link
Author

dboggs95 commented Sep 21, 2022

UPDATE: Using Hyper-V + GPU-P + Ubuntu Client does not appear to be an option either. Will post more details if you want them.

@dboggs95
Copy link
Author

dboggs95 commented Sep 22, 2022

UPDATE: AMD RX 580 8GB + Ubuntu 20.04. Not working and here's why. This would probably absolutely work with a newer graphics card, but since I have a Polaris GPU it won't. In ROCm 3.7 they broke Polaris GPU's for certain use cases. I guess they tried to fix it, but couldn't and gave up in 4.0. Luckily they didn't prevent you from trying to use it anyway, they just said it wasn't supported. However, the maintainers of PyTorch didn't make this any better, and removed all support of Polaris GPU's from their code. So now there are people all over the internet trying to use their RX 580's with AI Deep Learning and not getting anywhere. I tried some alternative builds and they didn't help me any.

I was going to try with the ROCm 3.10 build of PyTorch, because I think it was something very specific that broke with Tensorflow that wouldn't bother us, but PyTorch lost the builds for those, so the install commands fail. I have asked them to replace them, but have no idea whether they will do so. I think the best way to do it is to get an older version of PyTorch, and build it with ROCm 3.5. But it's not guaranteed to work, since a great deal could have changed since those versions.

For now I will see whether or not my CPU is up to the task. I drew a 128x128 in 40 minutes on Windows. I heard someone with much less power than I have drew a 1024x1024 image in 19 hours. I have an 3.5 ghz x 8 core CPU, with 16 GB of RAM that is now running on a slimmer OS. I should be able to go way faster than him, especially on a 512x512 prompt instead. I'll report my results from this later.

@dboggs95
Copy link
Author

Here is the issue I opened with PyTorch: pytorch/pytorch#85390

@dboggs95
Copy link
Author

dboggs95 commented Sep 22, 2022

UPDATE: I am running the make_art.py script with a prompt file and it's been spitting things out all night.

  1. I had to edit make_art.py like so: gpu_name = "cpu". It fails otherwise. If some kind of condition could be addition to the program so it could choose this as a default, that would be nice.
  2. I not sure I believe somebody was using a CPU to do a 1024x1024 image. I set mine to 512x512 and it seemed like ten minutes passed and it wouldn't complete an iteration. I dialed it down to 384 and I am doing 250 iterations in under 3 hours. Not terrible, but I guess the GPU would do it way faster.

@dboggs95 dboggs95 changed the title AMD Graphics on Windows 10 using WSL2 - Learning from Today's Attempt AMD Graphics Thread Sep 22, 2022
@zcgraas
Copy link

zcgraas commented Sep 24, 2022

Seconding the issue with the RX 580 card. I've tried on Ubuntu and CentOS to see if something outside of Debian would work but I've run into similar problems as you. Thanks for the research you've done, it has definitely helped me out with troubleshooting!

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