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

libtorch build failure #41790

Open
stalek71 opened this issue Oct 25, 2024 · 1 comment
Open

libtorch build failure #41790

stalek71 opened this issue Oct 25, 2024 · 1 comment
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@stalek71
Copy link

stalek71 commented Oct 25, 2024

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

I created a new project in Visual Studio 2022 for C++ based on CMake.
I added configuration for vcpkg (integration) and set the triplet to x64-windows.
In the vcpkg.json file, I specified a dependency for libtorch.
During compilation, an error appears as shown in the attached log file (it cannot find NVCC).
I have CUDA SDK (12.5) installed, and the nvcc file is available in the path.

Failure logs

vcpkg-manifest-install.log

Additional context

I have nvcc available in the path of course (info below).
Image

I use the latest version of VS 2022 and vcpkg.

@stalek71 stalek71 added the category:port-bug The issue is with a library, which is something the port should already support label Oct 25, 2024
@stalek71
Copy link
Author

stalek71 commented Oct 26, 2024

I switched env vars to CUDA 12.4 (as I I overlooked it), but it still doesn't compile LibTorch from vcpkg defs.
I decided to manually download LibTorch from Pytorch website and it worked like a charm.
I had to add only this operation below to force linker to link to cuda libs (for WIN32) and it reported
that cuda libs are in place and available for calc operations.

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCLUDE:?ignore_this_library_placeholder@@YAHXZ")

This is contents of vcpkgs file (so libtorch is without cuda feature):

{
  "dependencies": [
    "fmt",
    "nlohmann-json",
    "spdlog",
    "gtest",
    "libtorch"
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

2 participants