Skip to content

chore: Adding a guideline to build on Windows platform #1337

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

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions docsrc/getting_started/getting_started_with_windows.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.. _getting_started_windows:

Building Torch-TensorRT on Windows
====================================

Torch-TensorRT has community support for Windows platform using CMake

Prerequisite:

* Microsoft Visual Studio
* LibTorch
* TensorRT
* CUDA
* cuDNN


Build configuration
-------------------

* Open Microsoft Visual Studio
* Open Torch-TensorRT source code folder
* Open Manage configurations -> Edit JSON to open CMakeSettings.json file.
* Configure the CMake build configurations. Following is an example configuration:

.. code-block:: none

{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-S . -B out",
"buildCommandArgs": "cmake --build out",
"ctestCommandArgs": "",
"variables": [
{
"name": "CMAKE_MODULE_PATH",
"value": "$PWD\cmake\Modules",
"type": "FILEPATH"
},
{
"name": "Torch_DIR",
"value": "<Path to libtorch>\share\cmake\Torch",
"type": "FILEPATH"
},
{
"name": "TensorRT_ROOT",
"value": "<Path to TensorRT directory>",
"type": "FILEPATH"
},
{
"name": "CMAKE_BUILD_TYPE",
"value": "Release",
"type": " STRING"
}
]
}
]
}


Compilation
-----------

* Click Build -> Build All or directly press Ctrl + Shift + B

Note: After successful compilation, the build artifacts will be present at buildRoot path configured.

Installation
------------

* Build -> Install Torch-TensorRT

Note: After successful installation, the artifacts will be present at installRoot.