File size: 10,721 Bytes
31112ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# Manual Installation Guide For Windows & Linux

This guide covers installation for different GPU generations and operating systems.

## Requirements

### - Compatible GPU (GTX 10XX - RTX 50XX)
- Git [Git Download](https://github.com/git-for-windows/git/releases/download/v2.51.2.windows.1/Git-2.51.2-64-bit.exe)
- Build Tools for Visual Studio 2022 with C++ Extentions [Vs2022 Download](https://aka.ms/vs/17/release/vs_BuildTools.exe)
- Cuda Toolkit 12.8 or higher [Cuda Toolkit Download](https://developer.nvidia.com/cuda-downloads)
- Nvidia Drivers Up to Date [Nvidia Drivers Download](https://www.nvidia.com/en-us/software/nvidia-app/)
- FFMPEG downloaded, unzipped & the bin folder on PATH [FFMPEG Download](https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.0-latest-win64-gpl-8.0.zip)
- Python 3.10.9 [Python Download](https://www.python.org/ftp/python/3.10.9/python-3.10.9-amd64.exe)
- Miniconda [Miniconda Download](https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe) or Python venv


  <img width="1234" height="962" alt="miniconda_1234x962" src="https://github.com/user-attachments/assets/222650d9-77e1-4c9e-8319-dfba9bc409d3" />



## Installation for Nvidia GTX 10XX - RTX QUADRO - 50XX (Stable)

This installation uses PyTorch 2.6.0, Cuda 12.6 for GTX 10XX - RTX 30XX & PyTorch 2.7.1, Cuda 12.8 for RTX 40XX - 50XX which are well-tested and stable.

Unless you need absolutely to use Pytorch compilation (with RTX 50xx), it is not recommeneded to use PytTorch 2.8.0 as some System RAM memory leaks have been observed when switching models.

If you want to use the NV FP4 optimized kernels for RTX 50xx, you will need PyTorch 2.9.1 with Cuda 13.0

## Download Repo and Setup Conda Environment

 

### Clone the repository

#### First, Create a folder named Wan2GP, then open it, then right click & select "open in terminal", then copy & paste the following commands, one at a time.


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

#### Create Python 3.10.9 environment using Conda
```
conda create -n wan2gp python=3.10.9
```
#### Activate Conda Environment
```
conda activate wan2gp
```


# NOW CHOOSE INSTALLATION ACCORDING TO YOUR GPU


## Windows Installation for GTX 10XX -16XX Only


#### Windows Install PyTorch 2.6.0 with CUDA 12.6 for GTX 10XX -16XX Only
```shell
pip install torch==2.6.0+cu126 torchvision==0.21.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
```

#### Windows Install requirements.txt for GTX 10XX -16XX Only
```
pip install -r requirements.txt
```


## Windows Installation for RTX QUADRO - 20XX Only


#### Windows Install PyTorch 2.6.0 with CUDA 12.6 for RTX QUADRO - 20XX Only
```
pip install torch==2.6.0+cu126 torchvision==0.21.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
```
#### Windows Install Triton for RTX QUADRO - 20XX Only
```
pip install -U "triton-windows<3.3"
```
#### Windows Install Sage1 Attention for RTX QUADRO - 20XX Only
```
pip install sageattention==1.0.6
```
#### Windows Install requirements.txt for RTX QUADRO - 20XX Only
```
pip install -r requirements.txt
```


## Windows Installation for RTX 30XX Only


#### Windows Install PyTorch 2.6.0 with CUDA 12.6 for RTX 30XX Only
```
pip install torch==2.6.0+cu126 torchvision==0.21.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
```
#### Windows Install Triton for RTX 30XX Only
```
pip install -U "triton-windows<3.3"
```
#### Windows Install Sage2 Attention for RTX 30XX Only
```
pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.1.1-windows/sageattention-2.1.1+cu126torch2.6.0-cp310-cp310-win_amd64.whl
```
#### Windows Install requirements.txt for RTX 30XX Only
```
pip install -r requirements.txt
```


## Installation for RTX 40XX, 50XX Only

#### Windows Install PyTorch 2.7.1 with CUDA 12.8 for RTX 40XX - 50XX Only
```
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128
```
#### Windows Install Triton for RTX 40XX, 50XX Only
```
pip install -U "triton-windows<3.4"
```
#### Windows Install Sage2 Attention for RTX 40XX, 50XX Only
```
pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows/sageattention-2.2.0+cu128torch2.7.1-cp310-cp310-win_amd64.whl
```
#### Windows Install requirements.txt for RTX 40XX, 50XX Only
```
pip install -r requirements.txt
```

## Installation for 50XX Only PyTorch 2.9.1 Cuda 13.. for NVFP4 optimized kernels

#### Windows Install PyTorch 2.9.1 with CUDA 13.0 for RTX 50XX Only
```
pip install torch==2.9.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
```
#### Windows Install Triton for RTX 50XX Only
```
pip install -U "triton-windows<3.4"
```
#### Windows Install Sage2 Attention for RTX 50XX Only
```
pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post4/sageattention-2.2.0+cu130torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
```
#### Windows Install requirements.txt for RTX 50XX Only
```
pip install -r requirements.txt
```
## Optional

### Flash Attention

#### Windows
```
pip install https://github.com/Redtash1/Flash_Attention_2_Windows/releases/download/v2.7.0-v2.7.4/flash_attn-2.7.4.post1+cu128torch2.7.0cxx11abiFALSE-cp310-cp310-win_amd64.whl
```


# Linux Installation 

### Step 1: Download Repo and Setup Conda Environment

#### Clone the repository
```
git clone https://github.com/deepbeepmeep/Wan2GP.git
```
#### Change directory
```
cd Wan2GP
```

#### Create Python 3.10.9 environment using Conda
```
conda create -n wan2gp python=3.10.9
```
#### Activate Conda Environment
```
conda activate wan2gp
```

## Installation for RTX 10XX -16XX Only


#### Install PyTorch 2.6.0 with CUDA 12.6 for RTX 10XX -16XX Only
```shell
pip install torch==2.6.0+cu126 torchvision==0.21.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
```

#### Install requirements.txt for RTX 30XX Only
```
pip install -r requirements.txt
```


## Installation for RTX QUADRO - 20XX Only


#### Install PyTorch 2.6.0 with CUDA 12.6 for RTX QUADRO - 20XX Only
```
pip install torch==2.6.0+cu126 torchvision==0.21.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
```
#### Install Triton for RTX QUADRO - 20XX Only
```
pip install -U "triton<3.3"
```
#### Install Sage1 Attention for RTX QUADRO - 20XX Only
```
pip install sageattention==1.0.6
```
#### Install requirements.txt for RTX QUADRO - 20XX Only
```
pip install -r requirements.txt
```


## Installation for RTX 30XX Only


#### Install PyTorch 2.6.0 with CUDA 12.6 for RTX 30XX Only
```
pip install torch==2.6.0+cu126 torchvision==0.21.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
```
#### Install Triton for RTX 30XX Only
```
pip install -U "triton<3.3"
```
#### Install Sage2 Attention for RTX 30XX Only. Make sure it's Sage 2.1.1
```
python -m pip install "setuptools<=75.8.2" --force-reinstall
git clone https://github.com/thu-ml/SageAttention
cd SageAttention 
pip install -e .
```
#### Install requirements.txt for RTX 30XX Only
```
pip install -r requirements.txt
```


## Installation for RTX 40XX, 50XX Only

#### Install PyTorch 2.7.1 with CUDA 12.8 for RTX 40XX - 50XX Only
```
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128
```
#### Install Triton for RTX 40XX, 50XX Only
```
pip install -U "triton<3.4"
```
#### Install Sage Attention for RTX 40XX, 50XX Only. Make sure it's Sage 2.2.0
```
python -m pip install "setuptools<=75.8.2" --force-reinstall
git clone https://github.com/thu-ml/SageAttention
cd SageAttention 
pip install -e .
```
#### Install requirements.txt for RTX 40XX, 50XX Only
```
pip install -r requirements.txt
```
## Optional

### Flash Attention

#### Linux
```
pip install flash-attn==2.7.2.post1
```
 
## Attention Modes

### WanGP supports several attention implementations:

- **SDPA** (default): Available by default with PyTorch
- **Sage**: 30% speed boost with small quality cost
- **Sage2**: 40% speed boost 
- **Flash**: Good performance, may be complex to install on Windows

### Attention GPU Compatibility

- RTX 10XX: SDPA
- RTX 20XX: SPDA, Sage1
- RTX 30XX, 40XX: SDPA, Flash Attention, Xformers, Sage1, Sage2/Sage2++
- RTX 50XX: SDPA, Flash Attention, Xformers, Sage2/Sage2++ / Sage3

## Performance Profiles

Choose a profile based on your hardware:

- **Profile 3 (LowRAM_HighVRAM)**: Loads entire model in VRAM, requires 24GB VRAM for 8-bit quantized 14B model
- **Profile 4 (LowRAM_LowVRAM)**: Default, loads model parts as needed, slower but lower VRAM requirement

## Troubleshooting

### Sage Attention Issues

If Sage attention doesn't work:

1. Check if Triton is properly installed
2. Clear Triton cache
3. Fallback to SDPA attention:
   ```
   python wgp.py --attention sdpa
   ```

### Memory Issues

- Use lower resolution or shorter videos
- Enable quantization (default)
- Use Profile 4 for lower VRAM usage
- Consider using 1.3B models instead of 14B models


For more troubleshooting, see [TROUBLESHOOTING.md](TROUBLESHOOTING.md) 

## Optional Kernels for INT4 / FP4 quantized support
These kernels will offer optimized INT4 / FP4 dequantization.

**Please Note FP4 support is hardware dependent and will work only with RTX 50xx / sm120+ GPUs**


### Light2xv NVP4 Kernels Wheels for Windows / Python 3.10 / Pytorch 2.9.1 / Cuda 13.8 (RTX 50xx / sm120+ only !)
- Windows
   ```
  pip install https://github.com/deepbeepmeep/kernels/releases/download/Light2xv/lightx2v_kernel-0.0.1+torch2.9.1-cp39-abi3-win_amd64.whl
   ```

- Linux
   ```
  pip install https://github.com/deepbeepmeep/kernels/releases/download/Light2xv/lightx2v_kernel-0.0.1+torch2.9.1cu130-cp39-abi3-linux_x86_64.whl
   ```



### Nunchaku INT4/FP4 Kernels Wheels for Python 3.10   
- Windows (Pytorch 2.7.1 / Cuda 12.8) 
   ```
pip install https://github.com/deepbeepmeep/kernels/releases/download/v1.2.0_Nunchaku/nunchaku-1.2.0+torch2.7-cp310-cp310-win_amd64.whl
   ```
- Windows (Pytorch 2.9.1 / Cuda 13)
   ```
  pip install https://github.com/deepbeepmeep/kernels/releases/download/v1.2.0_Nunchaku/nunchaku-1.2.0+torch2.9-cp310-cp310-win_amd64.whl
   ```

- Linux (Pytorch 2.7.1 / Cuda 12.8) 
   ```
  pip install https://github.com/deepbeepmeep/kernels/releases/download/v1.2.0_Nunchaku/nunchaku-1.2.0+torch2.7-cp310-cp310-linux_x86_64.whl
   ```
- Windows (Pytorch 2.9.1 / Cuda 13)
   ```
  pip install https://github.com/deepbeepmeep/kernels/releases/download/v1.2.0_Nunchaku/nunchaku-1.2.0+torch2.9-cp310-cp310-linux_x86_64.whl
   ```