File size: 9,625 Bytes
4689c2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# AMD Installation Guide for Windows (TheRock)

This guide covers installation for AMD GPUs running under Windows using TheRock's official PyTorch wheels.

## Supported GPUs

Based on [TheRock's official support matrix](https://github.com/ROCm/TheRock/blob/main/SUPPORTED_GPUS.md), the following GPUs are supported on Windows:

### **gfx110X-all** (RDNA 3):
* AMD RX 7900 XTX (gfx1100)
* AMD RX 7800 XT (gfx1101)
* AMD RX 7700 XT (gfx1101)
* AMD RX 7700S / Framework Laptop 16 (gfx1102)
* AMD Radeon 780M Laptop iGPU (gfx1103)

### **gfx120X-all** (RDNA 4):
* AMD RX 9060 XT (gfx1200)
* AMD RX 9060 (gfx1200)
* AMD RX 9070 XT (gfx1201)
* AMD RX 9070 (gfx1201)

### **gfx1151** (RDNA 3.5 APU):
* AMD Strix Halo APUs

### **gfx1150** (RDNA 3.5 APU): 
* AMD Radeon 890M (Ryzen AI 9 HX 370 - Strix Point)

### Also supported:
### **gfx103X-dgpu**: (RDNA 2)

<br>

> **Note:** If your GPU is not listed above, it may not be supported by TheRock on Windows. Support status and future updates can be found in the [official documentation](https://github.com/ROCm/TheRock/blob/main/SUPPORTED_GPUS.md).

## Requirements

- Python 3.11 (recommended for Wan2GP - TheRock currently supports Python 3.11, 3.12, and 3.13).
- Windows 10/11

## Installation Environment

This installation uses PyTorch wheels built by TheRock.

### Installing Python

Download Python 3.11 from [python.org/downloads/windows](https://www.python.org/downloads/windows/). Press Ctrl+F and search for "3.11." to find the newest version available for installation.

Alternatively, you can use this direct link: [Python 3.11.9 (64-bit)](https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe).

After installing, make sure `python --version` works in your terminal and returns `3.11.9`

If it doesn’t, you need to add Python to your PATH:

* Press the `Windows` key, type `Environment Variables`, and select `Edit the system environment variables`.
* In the `System Properties` window, click `Environment Variables…`.
* Under `User variables`, find `Path`, then click `Edit``New` and add the following entries (replace `<username>` with your Windows username):

```cmd

C:\Users\<username>\AppData\Local\Programs\Python\Launcher\

C:\Users\<username>\AppData\Local\Programs\Python\Python311\Scripts\

C:\Users\<username>\AppData\Local\Programs\Python\Python311\

```

> **Note:** If Python still doesn't show the correct version after updating PATH, try signing out and signing back in to Windows to apply the changes.

### Installing Git

Download Git from [git-scm.com/downloads/windows](https://git-scm.com/install/windows) and install it. The default installation options are fine.


## Installation Steps (Windows, using a Python `venv`)
> **Note:** The following commands are intended for use in the Windows Command Prompt (CMD).  
> If you are using PowerShell, some commands (like comments and activating the virtual environment) may differ.


### Step 1: Download and set up Wan2GP Environment

```cmd

:: Navigate to your desired install directory

cd \your-path-to-wan2gp



:: Clone the repository

git clone https://github.com/deepbeepmeep/Wan2GP.git

cd Wan2GP



:: Create virtual environment

python -m venv wan2gp-env



:: Activate the virtual environment

wan2gp-env\Scripts\activate

```

> **Note:** If you have multiple versions of Python installed, use `py -3.11 -m venv wan2gp-env` instead of `python -m venv wan2gp-env` to ensure the correct version is used.

### Step 2: Install ROCm/PyTorch by TheRock

**IMPORTANT:** Choose the correct index URL for your GPU family!

#### For gfx110X-all (RX 7900 XTX, RX 7800 XT, etc.):

```cmd

pip install --pre torch torchaudio torchvision rocm[devel] --index-url https://rocm.nightlies.amd.com/v2/gfx110X-all/

```

#### For gfx120X-all (RX 9060, RX 9070, etc.):

```cmd

pip install --pre torch torchaudio torchvision rocm[devel] --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/

```

#### For gfx1151 (Strix Halo iGPU):

```cmd

pip install --pre torch torchaudio torchvision rocm[devel] --index-url https://rocm.nightlies.amd.com/v2/gfx1151/

```

#### For gfx1150 (Radeon 890M - Strix Point):

```cmd

pip install --pre torch torchaudio torchvision rocm[devel] --index-url https://rocm.nightlies.amd.com/v2-staging/gfx1150/

```

#### For gfx103X-dgpu (RDNA 2):

```cmd

pip install --pre torch torchaudio torchvision rocm[devel] --index-url https://rocm.nightlies.amd.com/v2-staging/gfx103X-dgpu/

```

This will automatically install the latest PyTorch, torchaudio, and torchvision wheels with ROCm support.

### Step 3: Install Wan2GP Dependencies

```cmd

:: Install core dependencies

pip install -r requirements.txt

```

### Step 4: Verify Installation

```cmd

python -c "import torch; print('PyTorch:', torch.__version__); print('ROCm available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'No GPU')"

```

Expected output example:
```

PyTorch: 2.11.0+rocm7.12.0

ROCm available: True

Device: AMD Radeon RX 9070 XT

```

## Attention Modes

WanGP supports multiple attention implementations via [triton-windows](https://github.com/woct0rdho/triton-windows/).

First, install `triton-windows` in your virtual environment.
If you have an older version of Triton installed, uninstall it first.
ROCm SDK needs to be initialized.
Visual Studio environment should also be activated.

```cmd

pip uninstall triton

pip install triton-windows

rocm-sdk init

"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1

```

### Supported attention implementations

- **SageAttention V1** (Requires the `.post26` wheel or newer to fix Triton compilation issues without needing unofficial patches. Download it from [this](https://github.com/Comfy-Org/wheels/actions/runs/21343435018) URL)

```cmd

pip install "sageattention <2"

```

- **FlashAttention-2** (Only the Triton backend is supported): 
```cmd

git clone https://github.com/Dao-AILab/flash-attention.git

cd flash-attention

pip install ninja

pip install packaging

set FLASH_ATTENTION_TRITON_AMD_ENABLE=TRUE && python setup.py install

```

- **SDPA Flash**: Available by default in PyTorch on post-RDNA2 GPUs via AOTriton.

## Running Wan2GP

For future sessions, activate the environment every time if it isn't already activated, then run `python wgp.py`:

```cmd

cd \path-to\Wan2GP

wan2gp-env\Scripts\activate

:: Add the AMD-specific environment variables mentioned below here

python wgp.py

```

It is advised to set the following environment variables at the start of every new session (you can create a `.bat` file that activates your venv, sets these, then launches `wgp.py`):

```cmd

set ROCM_HOME=%ROCM_ROOT%

set PATH=%ROCM_ROOT%\lib\llvm\bin;%ROCM_BIN%;%PATH%

set CC=clang-cl

set CXX=clang-cl

set DISTUTILS_USE_SDK=1

set FLASH_ATTENTION_TRITON_AMD_ENABLE=TRUE

set TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1

```

MIOpen (AMD’s equivalent of NVIDIA’s cuDNN) is not yet fully stable on several architectures; it can cause out-of-memory errors (OOMs), crash the display driver, or significantly increase generation times. Currently, it is recommended to use fast mode by setting:

```cmd

set MIOPEN_FIND_MODE=FAST

```

Alternatively, you can disable MIOpen entirely by editing `wgp.py` and adding the following line below `import torch` (around line 51):

```cmd

...

:: /lines already in the file/

:: ...

:: import torch

torch.backends.cudnn.enabled = False # <-- Add this here

:: import gc

:: ...

...

```

To verify that it is disabled, or to enable verbose logging, you can set:

```cmd

set MIOPEN_ENABLE_LOGGING=1

set MIOPEN_ENABLE_LOGGING_CMD=1

set MIOPEN_LOG_LEVEL=5

```

## Troubleshooting

### GPU Not Detected

If `torch.cuda.is_available()` returns `False`:

1. **Verify your GPU is supported** - Check the [Supported GPUs](#supported-gpus) list above
2. **Check AMD drivers** - Ensure you have the latest AMD Adrenalin drivers installed
3. **Verify correct index URL** - Make sure you used the right GPU family index URL

### Installation Errors

**"Could not find a version that satisfies the requirement":**
- Double-check that you're using the correct `--index-url` for your GPU family. You can also try adding the `--pre` flag or replacing `/v2/` in the URL with `/v2/staging/`
- Ensure you're using Python 3.11, and not 3.10

**"No matching distribution found":**
- Your GPU architecture may not be supported
- Check that you've activated your virtual environment

### Performance Issues

- **Monitor VRAM usage** - Reduce batch size or resolution if running out of memory
- **Close GPU-intensive apps** - Apps with hardware acceleration enabled (browsers, Discord etc.).

### Known Issues

Windows packages are new and may be unstable.

Known issues are tracked at: https://github.com/ROCm/TheRock/issues/808

## Additional Resources

- [TheRock GitHub Repository](https://github.com/ROCm/TheRock/)
- [Releases Documentation](https://github.com/ROCm/TheRock/blob/main/RELEASES.md)
- [Supported GPU Architectures](https://github.com/ROCm/TheRock/blob/main/SUPPORTED_GPUS.md)
- [Roadmap](https://github.com/ROCm/TheRock/blob/main/ROADMAP.md)
- [ROCm Documentation](https://rocm.docs.amd.com/)

For additional troubleshooting guidance for Wan2GP, see [TROUBLESHOOTING.md](https://github.com/deepbeepmeep/Wan2GP/blob/main/docs/TROUBLESHOOTING.md).