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

Does ROCm for Windows ever exist? #269

Open
daoxian opened this issue Jun 7, 2021 · 22 comments
Open

Does ROCm for Windows ever exist? #269

daoxian opened this issue Jun 7, 2021 · 22 comments

Comments

@daoxian
Copy link

daoxian commented Jun 7, 2021

Since the document says that Antares supports ROCm for Windows, I wonder whether this kind of thing exists in the world? The ROCm has been officially declared that there's no plans for Windows!

@ghostplant
Copy link
Contributor

ghostplant commented Jun 9, 2021

Yes. It has been supported by the end of 2020, as long as you have an AMDGPU that satisfy ROCm's official supported list, e.g. Radeon7, Vega64, etc.

You need to install latest AMD driver for Windows (version >= 2020.12), after you complete the AMD driver installation, you should see there is a runtime library C:\Windows\System32\amdhip64.dll. This means you can interactive with it to execute ROCm workloads.

Antares has already been able to interactive with this runtime library directly. What you need is:

  1. Install latest AMD driver for Win10 to ensure C:\Windows\System32\amdhip64.dll exists.
  2. Install WSL1.0 based on Ubuntu 18.04/20.04 image.
  3. In WSL1.0, install Antares dependent packages: sudo apt install git python3-pip g++ make g++-mingw-w64-x86-64
  4. Next, using git in WSL1.0 to clone Antares and try some examples executed by ROCm backend, e.g. BACKEND=c-rocm_win64 make

@daoxian
Copy link
Author

daoxian commented Jun 9, 2021

Yes. It has been supported by the end of 2020, as long as you have an AMDGPU that satisfy ROCm's official supported list, e.g. Radeon7, Vega64, etc.

You need to install latest AMD driver for Windows (version >= 2020.12), after you complete the AMD driver installation, you should see there is a runtime library C:\Windows\System32\amdhip64.dll. This means you can interactive with it to execute ROCm workloads.

Antares has already been able to interactive with this runtime library directly. What you need is:

  1. Install latest AMD driver for Win10 to ensure C:\Windows\System32\amdhip64.dll exists.
  2. Install WSL1.0 based on Ubuntu 18.04/20.04 image.
  3. In WSL1.0, install Antares dependent packages: sudo apt install git python3-pip g++ make g++-mingw-w64-x86-64
  4. Then in WSL1.0, clone Antares and type some examples to run by ROCm, e.g. BACKEND=c-rocm_win64 make

OKay, that sounds amazing... Let me have a try and thanks a lot!

@Column01
Copy link

Can I use this with WSL2 or does it need to be WSL1?

@ghostplant
Copy link
Contributor

ghostplant commented Aug 11, 2021

@Column01 I didn't try whether it can work in WSL2. I'll verify it later.

@ghostplant
Copy link
Contributor

@Column01 WSL2 should work since this PR (#282), which makes two backends DirectX12 & ROCm work in both WSL1 and WSL2.

Because it is for WSL instead of real Linux, so by default, it will work using DirectX12 for acceleration whose backend name is c-hlsl_win64.

If you explicitly set export BACKEND=c-rocm_win64 or BACKEND=c-rocm_win64 make, it will recognize this backend change and be going to work using Windows-side AMD ROCm driver.

Note that Windows-side AMD ROCm driver only provide runtime instead of HIP compiler, so we still need to install rocm-dev in WSL according to ROCm Official Guide which would be only used to compile the C-based source code.

@Column01
Copy link

Column01 commented Aug 11, 2021

Hmm. Maybe I'm misunderstanding but would this let me run PyTorch using ROCm on windows? I'm pretty new to ML and GPU computing in general.

Basically I guess my question is would this only be for compiling ROCm code I've written to work on Windows or could it let me run linux ROCm code on windows and in this case, PyTorch?

Assuming I install it under WSL2 and run this, PyTorch should see my AMD gpu correct?

@ghostplant
Copy link
Contributor

ghostplant commented Aug 12, 2021

@Column01 Antares is not a virtual machine but device code generator and optimizer for devices it covers. So your understanding of letting you to run "ROCm device kernel" using "native Windows AMDGPU" is correct, and it is not the component to make the full-stack of ROCm to work in WSL as Linux mode.

Briefly, this c-rocm_win64 backend will satisfy customers who have "Windows OS + ROCm GPU" and want Standard Win64 applications to run clean ROCm device code, and Antares will help to generate Windows ROCm device code for that.

@LuisB79
Copy link

LuisB79 commented Apr 19, 2022

Briefly, this c-rocm_win64 backend will satisfy customers who have "Windows OS + ROCm GPU" and want Standard Win64 applications to run clean ROCm device code, and Antares will help to generate Windows ROCm device code for that.

can i run HIP code with this?

@ghostplant
Copy link
Contributor

Yes, Just try this in windows WSL.

pip3 install --upgrade antares
BACKEND=c-rocm_win64 antares

@LuisB79
Copy link

LuisB79 commented Apr 19, 2022

i will, it's just that i have gfx1031 and there is no official support for it afaik, but it seems i can compile with flags to enable support on gfx1031, should i try and compile rocm with support for gfx1031? or does wsl2 helps with this?

@LuisB79
Copy link

LuisB79 commented Apr 22, 2022

Yes, Just try this in windows WSL.

pip3 install --upgrade antares
BACKEND=c-rocm_win64 antares

i have an gfx1031 and there is no official support for it. It seems i can compile rocm with flags to enable support on gfx1031 since it gfx1030 is currently supported, should i try and compile rocm with support for gfx1031? or does wsl2 helps with this?

@ghostplant
Copy link
Contributor

ghostplant commented Apr 22, 2022

Yes, Just try this in windows WSL.

pip3 install --upgrade antares
BACKEND=c-rocm_win64 antares

i have an gfx1031 and there is no official support for it. It seems i can compile rocm with flags to enable support on gfx1031 since it gfx1030 is currently supported, should i try and compile rocm with support for gfx1031? or does wsl2 helps with this?

You can try that, we even did similar things for gfx1010, which is also not officially supported by HIP, but it can work by Antares + Windows 10 WSL 1.0 + Last version of C:\Windows\System32\amdhip64.dll.

@LuisB79
Copy link

LuisB79 commented Apr 22, 2022

Yes, Just try this in windows WSL.

pip3 install --upgrade antares
BACKEND=c-rocm_win64 antares

i have an gfx1031 and there is no official support for it. It seems i can compile rocm with flags to enable support on gfx1031 since it gfx1030 is currently supported, should i try and compile rocm with support for gfx1031? or does wsl2 helps with this?

You can try that, we even did similar things for gfx1010, which is also not officially supported by HIP, but it can work by Antares + Windows 10 WSL 1.0 + Last version of C:\Windows\System32\amdhip64.dll.

does it need to be wsl1? or wls2?, also wonderful

@ghostplant
Copy link
Contributor

Current Antares needs to work in WSL, but won't in the future.

@cstueckrath
Copy link

any news on this?
Would you share how you compiled rocm with support for other cards?

@ghostplant
Copy link
Contributor

any news on this? Would you share how you compiled rocm with support for other cards?

Just follow instructions above, the only difference for other amdgpu is choosing a different gfx number.

@heloess
Copy link

heloess commented Jan 5, 2023

It actually exists but not publicly available
https://wiki.blender.org/wiki/Building_Blender/GPU_Binaries#AMD

@BBC-Esq
Copy link

BBC-Esq commented Oct 16, 2023

Was this ever solved definitively? I'm building programs that use PyTorch and gpu acceleration, but apparently PyTorch only supports AMD GPUs on Linux, not Windows. It'd be great to have clear installation instructions to install WSL on conjunction with RocM on Windows to utilize an AMD GPU acceleration! Here's my repo where you can see in my installation instructions that I've been struggling with this for a long time...https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio

And here's a link to a summary of the possible solutions I've found so far...But using WSL seems the best so far: https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio/issues/4

@ghostplant
Copy link
Contributor

Was this ever solved definitively? I'm building programs that use PyTorch and gpu acceleration, but apparently PyTorch only supports AMD GPUs on Linux, not Windows. It'd be great to have clear installation instructions to install WSL on conjunction with RocM on Windows to utilize an AMD GPU acceleration! Here's my repo where you can see in my installation instructions that I've been struggling with this for a long time...https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio

And here's a link to a summary of the possible solutions I've found so far...But using WSL seems the best so far: https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio/issues/4

Does it depend on Pytorch operators? If all operators can be defintely by yourself, you can use this https://github.com/microsoft/antares#quick-test-1-create-custom-operator-of-your-own-in-pytorch-2 to create and accelerate them by GPU on windows (no longer WSL needed.)

@LuisB79
Copy link

LuisB79 commented Oct 17, 2023

Was this ever solved definitively? I'm building programs that use PyTorch and gpu acceleration, but apparently PyTorch only supports AMD GPUs on Linux, not Windows. It'd be great to have clear installation instructions to install WSL on conjunction with RocM on Windows to utilize an AMD GPU acceleration! Here's my repo where you can see in my installation instructions that I've been struggling with this for a long time...https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio

And here's a link to a summary of the possible solutions I've found so far...But using WSL seems the best so far: https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio/issues/4

AFAIK Rocm was released for windows, but if you dont have a pro card or a NX1 card you will havve issues and you will have to do other steps to get it working, i dont know which ones doe

@ghostplant
Copy link
Contributor

Was this ever solved definitively? I'm building programs that use PyTorch and gpu acceleration, but apparently PyTorch only supports AMD GPUs on Linux, not Windows. It'd be great to have clear installation instructions to install WSL on conjunction with RocM on Windows to utilize an AMD GPU acceleration! Here's my repo where you can see in my installation instructions that I've been struggling with this for a long time...https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio
And here's a link to a summary of the possible solutions I've found so far...But using WSL seems the best so far: https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio/issues/4

AFAIK Rocm was released for windows, but if you dont have a pro card or a NX1 card you will havve issues and you will have to do other steps to get it working, i dont know which ones doe

What is the progress? Having SDK already, or supporting Windows applications like Pytorch?

@BBC-Esq
Copy link

BBC-Esq commented Oct 18, 2023

What is the progress? Having SDK already, or supporting Windows applications like Pytorch?

Basically, I'm using it to create vector databases and interact with a large language model,
so basic PyTorch stuff. NVIDIA and AMD GPUs are supported on Linux. NVIDIA GPUs are supported on Windows.
The only outlier is that AMD GPUs are not supported on Windows.

Honestly, programming is not my trade, so I don't know what operators even means referring to PyTorch.
Any help would be much appreciated.

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

7 participants