|
1 | | -.. Licensed to the Apache Software Foundation (ASF) under one |
| 1 | +.. Licensed to the Apache Software Foundation (ASF) under one |
2 | 2 | or more contributor license agreements. See the NOTICE file |
3 | 3 | distributed with this work for additional information |
4 | 4 | regarding copyright ownership. The ASF licenses this file |
@@ -232,6 +232,71 @@ The following commands can be used to install the extra Python dependencies: |
232 | 232 | pip3 install tornado psutil 'xgboost>=1.1.0' cloudpickle |
233 | 233 |
|
234 | 234 |
|
| 235 | +.. _windows-build-notes: |
| 236 | + |
| 237 | +Windows-Specific Build Notes |
| 238 | +---------------------------- |
| 239 | + |
| 240 | +If you're building TVM on Windows, note these platform-specific considerations: |
| 241 | + |
| 242 | +File Encoding |
| 243 | +............. |
| 244 | +- Ensure Python files are saved as **UTF-8 without BOM** (Byte Order Mark) |
| 245 | +- BOM characters cause ``SyntaxError: invalid non-printable character U+FEFF`` |
| 246 | +- In VS Code: Bottom-right encoding → "Save with Encoding" → "UTF-8" |
| 247 | + |
| 248 | +Path Conventions |
| 249 | +................ |
| 250 | +- Use forward slashes (``/``) in Python/CMake paths, not Windows backslashes |
| 251 | +- Example: ``python cmake/config.cmake`` not ``python cmake\\config.cmake`` |
| 252 | + |
| 253 | +Common Windows Build Issues |
| 254 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 255 | + |
| 256 | +CUDA Configuration |
| 257 | +.................. |
| 258 | +For CUDA support: |
| 259 | + |
| 260 | +.. code-block:: batch |
| 261 | +
|
| 262 | + set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8 |
| 263 | + set PATH=%CUDA_PATH%\bin;%PATH% |
| 264 | + cmake .. -DUSE_CUDA=ON |
| 265 | +
|
| 266 | +CMake & Compiler Setup |
| 267 | +...................... |
| 268 | +- Use CMake GUI or specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..`` |
| 269 | +- Ensure Python is in PATH or specify: ``-DPython_EXECUTABLE=C:\Python39\python.exe`` |
| 270 | + |
| 271 | +Development Environment Tips |
| 272 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 273 | + |
| 274 | +Git Configuration |
| 275 | +................. |
| 276 | +.. code-block:: bash |
| 277 | +
|
| 278 | + git config --global core.autocrlf input |
| 279 | +
|
| 280 | +VS Code Settings |
| 281 | +................ |
| 282 | +Add to ``settings.json``: |
| 283 | + |
| 284 | +.. code-block:: json |
| 285 | +
|
| 286 | + { |
| 287 | + "files.encoding": "utf8", |
| 288 | + "files.autoGuessEncoding": false, |
| 289 | + "[python]": { "files.encoding": "utf8" } |
| 290 | + } |
| 291 | +
|
| 292 | +WSL2 Alternative |
| 293 | +~~~~~~~~~~~~~~~~ |
| 294 | +For Linux-like environment: Install WSL2 (Ubuntu recommended) and follow Linux instructions. |
| 295 | + |
| 296 | +For more help, report Windows-specific issues on GitHub with your Windows version, |
| 297 | +Visual Studio version, and complete error logs. |
| 298 | + |
| 299 | + |
235 | 300 | Advanced Build Configuration |
236 | 301 | ---------------------------- |
237 | 302 |
|
|
0 commit comments