PWhiddy / PokemonRedExperiments

Playing Pokemon Red with Reinforcement Learning
MIT License
6.88k stars 629 forks source link

How do I use my [AMD] GPU #181

Open NiuAWSM opened 3 months ago

NiuAWSM commented 3 months ago

Hello! Im having a blast training the AI! :D Im running the training on win11 right now. It works, but my CPU is so much worse than my GPU... What do I have to do to run it on my 7900xtx? I followed the win guide to setup the project. Help is much appreciated^^ :) Thanks!

PWhiddy commented 3 months ago

Hi!

Generally ML frameworks like pytorch (which stable baselines and therefore this repo uses) don't have great support for non-nvidia gpus.

I'm not sure if using an amd gpu with pytorch on windows as possible at all. You might be able to get it to work by using windows subsystem for linux (WSL) and installing the ROCm version of pytorch, but it might be a bit of a process and I have not tested it myself.

Hope that's helpful! Do report back if you end up trying it :)

NiuAWSM commented 2 months ago

Hey thanks for answering! I got pytorch 2.1.2+rocm6.1.3 working on WSL. how do I use GPU instead of CPU?

PWhiddy commented 2 months ago

For others seeing this issue, following these instructions seemed to do the trick

https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/howto_wsl.html

if this is installed correctly the gpu should be used automatically