KEMBAR78
Eliminate uses of deprecated `FindCUDA.cmake` · Issue #76082 · pytorch/pytorch · GitHub
Skip to content

Eliminate uses of deprecated FindCUDA.cmake #76082

@peterbell10

Description

@peterbell10

find_package(CUDA) is the legacy way of using CMake to build CUDA code and was deprecated in CMake 3.10. #62445 transitioned over to enable_language(CUDA) which gives first class support for CUDA as a language in CMake. However, find_package(CUDA) is still being used to locate the CUDA toolkit libraries. This is potentially dangerous because we have two different mechanisms searching for the CUDA installation, each with their own configuration variables. So, it would be best to stop using FindCUDA.cmake entirely.

The modern CMake equivalent for library targets is find_package(CUDAToolkit) which requires CMake 3.17, so we can't assume it's present yet. However, it might also be possible to vendor FindCUDAToolkit.cmake and use it anyway.

There are also dependencies in third_party which still use find_package(CUDA)

cc @malfet @seemethere @ngimel

Metadata

Metadata

Assignees

No one assigned

    Labels

    better-engineeringRelatively self-contained tasks for better engineering contributorsmodule: 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