Skip to content

libtroch_cuda.so is missing in TORCH_LIBRARIES and TORCH_CUDA_LIBRARIES in PyTorch CMake #137694

@guangyey

Description

@guangyey

libtroch_cuda.so is missing in TORCH_LIBRARIES and TORCH_CUDA_LIBRARIES in PyTorch CMake if build flag BUILD_SHARED_LIBS is enabled, for example

find_package(Torch REQUIRED)
# libtorch_cuda.so is missing in TORCH_CUDA_LIBRARIES and TORCH_LIBRARIES
message(STATUS ${TORCH_CUDA_LIBRARIES} ${TORCH_LIBRARIES})

The impact is the user can't find libtorch_cuda.so via PyTorch CMake. They need to find it by themselves. This is not a friendly user experience.

cc @malfet @seemethere @ptrblck @msaroufim

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: buildBuild system issuesmodule: cudaRelated to torch.cuda, and CUDA support in generaltriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions