From b8f775b8b694a30f8421c374d7f64926cce5d4d1 Mon Sep 17 00:00:00 2001 From: Anurag Dixit Date: Wed, 7 Sep 2022 14:42:44 -0700 Subject: [PATCH 1/2] chore: Adding Windows build guideline Signed-off-by: Anurag Dixit --- .../getting_started_with_windows.rst | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 docsrc/getting_started/getting_started_with_windows.rst diff --git a/docsrc/getting_started/getting_started_with_windows.rst b/docsrc/getting_started/getting_started_with_windows.rst new file mode 100644 index 0000000000..d938fe286a --- /dev/null +++ b/docsrc/getting_started/getting_started_with_windows.rst @@ -0,0 +1,74 @@ +.. _getting_started_windows: + +Building Torch-TensorRT on Windows +==================================== + +Torch-TensorRT has community support for Windows platform using CMake + +Pre-requisite + +* 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:: JSON + { + "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": "\share\cmake\Torch", + "type": "FILEPATH" + }, + { + "name": "TensorRT_ROOT", + "value": "", + "type": "FILEPATH" + }, + { + "name": "CMAKE_BUILD_TYPE", + "value": "Release", + "type": " STRING" + } + ] + } + ] +} + +.. Compilation: + +* Build -> Build All OR 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. \ No newline at end of file From 321f184a4fb13a467773d78fa1381b87852620de Mon Sep 17 00:00:00 2001 From: Anurag Dixit Date: Wed, 7 Sep 2022 14:54:01 -0700 Subject: [PATCH 2/2] chore: Fix formatting Signed-off-by: Anurag Dixit --- .../getting_started_with_windows.rst | 82 ++++++++++--------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/docsrc/getting_started/getting_started_with_windows.rst b/docsrc/getting_started/getting_started_with_windows.rst index d938fe286a..d5d3394855 100644 --- a/docsrc/getting_started/getting_started_with_windows.rst +++ b/docsrc/getting_started/getting_started_with_windows.rst @@ -5,7 +5,7 @@ Building Torch-TensorRT on Windows Torch-TensorRT has community support for Windows platform using CMake -Pre-requisite +Prerequisite: * Microsoft Visual Studio * LibTorch @@ -14,60 +14,64 @@ Pre-requisite * cuDNN -.. Build configuration: +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 -.. code-block:: JSON { - "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": "\share\cmake\Torch", - "type": "FILEPATH" - }, + "configurations": [ { - "name": "TensorRT_ROOT", - "value": "", - "type": "FILEPATH" - }, - { - "name": "CMAKE_BUILD_TYPE", - "value": "Release", - "type": " STRING" + "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": "\share\cmake\Torch", + "type": "FILEPATH" + }, + { + "name": "TensorRT_ROOT", + "value": "", + "type": "FILEPATH" + }, + { + "name": "CMAKE_BUILD_TYPE", + "value": "Release", + "type": " STRING" + } + ] } - ] + ] } - ] -} -.. Compilation: -* Build -> Build All OR Ctrl + Shift + B +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: +Installation +------------ * Build -> Install Torch-TensorRT