Skip to content
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

Get windows build working #1711

Merged
merged 2 commits into from
Mar 21, 2023
Merged

Get windows build working #1711

merged 2 commits into from
Mar 21, 2023

Conversation

bharrisau
Copy link
Contributor

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

  • Bug fix (incomplete and probably breaks other build targets)
  • This change requires a documentation update

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

  • Install Visual Studio Code
  • Install Build Tools for Visual Studio 2022
    • Select "Desktop Development with C++"
      • Currently, this installs MSVC v143 - 2022. There are also options to install previous 2019/2017/2015 editions of MSVC
    • License term "1b Build Tools additional use right" allows using Build Tools to compile Open Source Dependencies
    • Also allows using Build Tools to develop and test Open Source Dependencies, to the minor extend of ensuring compatibility with Build Tools
  • Install CUDA 11.7.1
  • Install CuDNN 8.5.0.96
    • Set cuDNN_ROOT_DIR
  • Install TensorRT 8.5.1.7
    • Set TensorRT_ROOT
    • Add TensorRT_ROOT\lib to PATH
  • Install "libtorch-win-shared-with-deps-latest.zip"
    • Select the CUDA 11.7 version
    • Set Torch_DIR
    • Add Torch_DIR\lib to PATH
  • Clone TensorRT repo
  • Install C++ and CMake Tools extensions from MS
    • Change build to RelWithDebInfo
  • Update .vscode\settings.json
  • Clean, configure, build

/.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"
}

@facebook-github-bot
Copy link
Contributor

Hi @bharrisau!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@github-actions github-actions bot requested a review from narendasan March 3, 2023 17:05
@narendasan
Copy link
Collaborator

Awesome @bharrisau, thanks for opening this. Will take a look.

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a chance to try this out. LGTM! Thanks for taking the time to fix this!

@narendasan narendasan merged commit 93b0400 into pytorch:main Mar 21, 2023
@bharrisau bharrisau deleted the win-build branch March 22, 2023 04:08
bowang007 pushed a commit that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants