From 2bfd31eb29088d5370d1d5ced0ec6c751c6a3965 Mon Sep 17 00:00:00 2001 From: AshwiniBokka Date: Mon, 2 Feb 2026 17:42:39 +0530 Subject: [PATCH 1/6] Add Windows-specific build notes to installation guide Adds 'Windows-Specific Build Notes' section after Step 5 in from_source.rst covering: 1. File encoding (UTF-8 without BOM) 2. Path conventions (forward vs backslashes) 3. CUDA configuration on Windows 4. CMake and compiler setup 5. Common Windows build issues 6. Development environment tips (Git, VS Code) 7. WSL2 alternative Based on contributor experience with Windows development environment. --- docs/install/from_source.rst | 67 +++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/docs/install/from_source.rst b/docs/install/from_source.rst index ee81f8477835..03cd364154d9 100644 --- a/docs/install/from_source.rst +++ b/docs/install/from_source.rst @@ -1,4 +1,4 @@ -.. Licensed to the Apache Software Foundation (ASF) under one +.. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file @@ -232,6 +232,71 @@ The following commands can be used to install the extra Python dependencies: pip3 install tornado psutil 'xgboost>=1.1.0' cloudpickle +.. _windows-build-notes: + +Windows-Specific Build Notes +---------------------------- + +If you're building TVM on Windows, note these platform-specific considerations: + +File Encoding +............. +- Ensure Python files are saved as **UTF-8 without BOM** (Byte Order Mark) +- BOM characters cause ``SyntaxError: invalid non-printable character U+FEFF`` +- In VS Code: Bottom-right encoding → "Save with Encoding" → "UTF-8" + +Path Conventions +................ +- Use forward slashes (``/``) in Python/CMake paths, not Windows backslashes +- Example: ``python cmake/config.cmake`` not ``python cmake\\config.cmake`` + +Common Windows Build Issues +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +CUDA Configuration +.................. +For CUDA support: + +.. code-block:: batch + + set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8 + set PATH=%CUDA_PATH%\bin;%PATH% + cmake .. -DUSE_CUDA=ON + +CMake & Compiler Setup +...................... +- Use CMake GUI or specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..`` +- Ensure Python is in PATH or specify: ``-DPython_EXECUTABLE=C:\Python39\python.exe`` + +Development Environment Tips +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Git Configuration +................. +.. code-block:: bash + + git config --global core.autocrlf input + +VS Code Settings +................ +Add to ``settings.json``: + +.. code-block:: json + + { + "files.encoding": "utf8", + "files.autoGuessEncoding": false, + "[python]": { "files.encoding": "utf8" } + } + +WSL2 Alternative +~~~~~~~~~~~~~~~~ +For Linux-like environment: Install WSL2 (Ubuntu recommended) and follow Linux instructions. + +For more help, report Windows-specific issues on GitHub with your Windows version, +Visual Studio version, and complete error logs. + + Advanced Build Configuration ---------------------------- From e77c599e05eb53dd75e18c860fc5d226c2535a7f Mon Sep 17 00:00:00 2001 From: AshwiniBokka Date: Tue, 3 Feb 2026 17:38:36 +0530 Subject: [PATCH 2/6] Add CI hotfix for ml-dtypes conflict --- .ci_hotfix.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .ci_hotfix.sh diff --git a/.ci_hotfix.sh b/.ci_hotfix.sh new file mode 100644 index 000000000000..5e10ca829646 --- /dev/null +++ b/.ci_hotfix.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Hotfix for GPU CI ml-dtypes conflict +echo "Applying ml-dtypes hotfix..." +pip install "ml-dtypes>=0.4.0,<0.5.0" --force-reinstall From db0f4bf12335e0c5004e875330202eed77688fe4 Mon Sep 17 00:00:00 2001 From: AshwiniBokka Date: Tue, 3 Feb 2026 17:44:17 +0530 Subject: [PATCH 3/6] Remove unused hotfix script --- .ci_hotfix.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .ci_hotfix.sh diff --git a/.ci_hotfix.sh b/.ci_hotfix.sh deleted file mode 100644 index 5e10ca829646..000000000000 --- a/.ci_hotfix.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Hotfix for GPU CI ml-dtypes conflict -echo "Applying ml-dtypes hotfix..." -pip install "ml-dtypes>=0.4.0,<0.5.0" --force-reinstall From 8be67bf811aa0890eadf63bcd1a8f2d472b1dc66 Mon Sep 17 00:00:00 2001 From: AshwiniBokka Date: Tue, 3 Feb 2026 18:45:51 +0530 Subject: [PATCH 4/6] docs: Move CUDA/CMake to Building on Windows, remove duplicates --- docs/install/from_source.rst | 58 ++++++++++-------------------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/docs/install/from_source.rst b/docs/install/from_source.rst index 03cd364154d9..dbf9b381f422 100644 --- a/docs/install/from_source.rst +++ b/docs/install/from_source.rst @@ -253,49 +253,6 @@ Path Conventions Common Windows Build Issues ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CUDA Configuration -.................. -For CUDA support: - -.. code-block:: batch - - set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8 - set PATH=%CUDA_PATH%\bin;%PATH% - cmake .. -DUSE_CUDA=ON - -CMake & Compiler Setup -...................... -- Use CMake GUI or specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..`` -- Ensure Python is in PATH or specify: ``-DPython_EXECUTABLE=C:\Python39\python.exe`` - -Development Environment Tips -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Git Configuration -................. -.. code-block:: bash - - git config --global core.autocrlf input - -VS Code Settings -................ -Add to ``settings.json``: - -.. code-block:: json - - { - "files.encoding": "utf8", - "files.autoGuessEncoding": false, - "[python]": { "files.encoding": "utf8" } - } - -WSL2 Alternative -~~~~~~~~~~~~~~~~ -For Linux-like environment: Install WSL2 (Ubuntu recommended) and follow Linux instructions. - -For more help, report Windows-specific issues on GitHub with your Windows version, -Visual Studio version, and complete error logs. - Advanced Build Configuration ---------------------------- @@ -340,6 +297,21 @@ You can then run the following command to build cmake --build build --config Release -- /m +CUDA Configuration +.................. +For CUDA support on Windows: + +.. code-block:: batch + + set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8 + set PATH=%CUDA_PATH%\bin;%PATH% + cmake .. -DUSE_CUDA=ON + +CMake & Compiler Setup +...................... +- Use CMake GUI or specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..`` +- Ensure Python is in PATH or specify: ``-DPython_EXECUTABLE=C:\Python39\python.exe`` + Building ROCm support ~~~~~~~~~~~~~~~~~~~~~ From 5a648cf492a40a9d5f3858053098219c8608c029 Mon Sep 17 00:00:00 2001 From: AshwiniBokka Date: Sat, 7 Feb 2026 16:22:47 +0530 Subject: [PATCH 5/6] docs: Address maintainer feedback - remove tool specifics and empty section --- docs/install/from_source.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/install/from_source.rst b/docs/install/from_source.rst index dbf9b381f422..c8be33b1d184 100644 --- a/docs/install/from_source.rst +++ b/docs/install/from_source.rst @@ -243,17 +243,13 @@ File Encoding ............. - Ensure Python files are saved as **UTF-8 without BOM** (Byte Order Mark) - BOM characters cause ``SyntaxError: invalid non-printable character U+FEFF`` -- In VS Code: Bottom-right encoding → "Save with Encoding" → "UTF-8" +- Use a text editor that supports saving as UTF-8 without BOM. Path Conventions ................ - Use forward slashes (``/``) in Python/CMake paths, not Windows backslashes - Example: ``python cmake/config.cmake`` not ``python cmake\\config.cmake`` -Common Windows Build Issues -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Advanced Build Configuration ---------------------------- @@ -309,7 +305,7 @@ For CUDA support on Windows: CMake & Compiler Setup ...................... -- Use CMake GUI or specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..`` +- Specify generator: ``cmake -G "Visual Studio 16 2019" -A x64 ..`` - Ensure Python is in PATH or specify: ``-DPython_EXECUTABLE=C:\Python39\python.exe`` @@ -340,3 +336,4 @@ tests in TVM. The easiest way to install GTest is from source. sudo make install After installing GTest, the C++ tests can be built and started with ``./tests/scripts/task_cpp_unittest.sh`` or just built with ``make cpptest``. + From 9e00491e6b92fcf988f20c83f5454676783dce0a Mon Sep 17 00:00:00 2001 From: AshwiniBokka Date: Sat, 7 Feb 2026 16:38:10 +0530 Subject: [PATCH 6/6] docs: Fix trailing newline for lint compliance --- docs/install/from_source.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/install/from_source.rst b/docs/install/from_source.rst index c8be33b1d184..3008b53c3465 100644 --- a/docs/install/from_source.rst +++ b/docs/install/from_source.rst @@ -336,4 +336,3 @@ tests in TVM. The easiest way to install GTest is from source. sudo make install After installing GTest, the C++ tests can be built and started with ``./tests/scripts/task_cpp_unittest.sh`` or just built with ``make cpptest``. -