Get windows build working by bharrisau · Pull Request #1711 · pytorch/TensorRT (original) (raw)

Description

Initial PR for #1563. Fixes Windows CMAKE build.

Finally had time to come back to this - build on a fresh Windows11 machine, all steps to setup/reproduce included.

The change to core/plugins/CMakeLists.txt seems like it should be unrelated to this. I was unable to build because 'cudnn.h' was required, but the include path was not being passed to the compiler as the cuDNN module wasn't specified. This might not be a problem in other targets because commonly the cudnn files are just installed in to the cuda include/lib/bin dirs.

Also note - windows is generally case insensitive. The normal output dir is build/ but that doesn't work on Windows as there is a BUILD file. So I'm using out/ as the output. But that isn't in the .gitignore, and I haven't included a change for that in this PR.

Type of change

Notes to reproduce with Visual Studio Code (I didn't want to pull down the whole Visual Studio)

/.vscode/settings.json

{ "cmake.generator": "Ninja", "cmake.configureSettings": { "CMAKE_MODULE_PATH": { "type": "FILEPATH", "value": "$PWD\cmake\Modules" }, "CMAKE_CXX_FLAGS": { "type": "STRING", "value": "-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" }, "Torch_DIR": { "type": "FILEPATH", "value": "X:\libtorch\share\cmake\Torch" }, "TensorRT_ROOT": { "type": "FILEPATH", "value": "X:\path\to\tensorrt" }, "cuDNN_ROOT_DIR": { "type": "FILEPATH", "value": "X:\path\to\cudnn" }, "CMAKE_CUDA_FLAGS": "-allow-unsupported-compiler" }, "cmake.buildDirectory": "${workspaceFolder}/out" }