[PATCH] D89974: [driver][CUDA] Use CMake's FindCUDA as default --cuda-path.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 12:15:37 PDT 2020


tra added a comment.

> Shortcomings in the testrunner don't seem like a reason to introduce new build-time configured default search paths into the driver.

+1

The root of the problem is that we rely on CUDA SDK as the external dependency and we have no way to reliably predict where the user will put it.
Generally speaking, the location of that dependency is specific to particular machine. I.e. I can have CUDA installed pretty much anywhere I want. Different distributions may install it anywhere they want. There may be multiple versions installed and clang has no basis to guess which one the user intends to use.

I do not see a way to make it work reliably without explicit input from the end user. Making the heuristic dependent on clang's build environment is not improving the situation, IMO. It may help some users, but it will disrupt others and it will introduce more confusion about where specific clang binary searches for CUDA installations.

CUDA path is sort of a global configuration parameter for all CUDA compilations. Perhaps we should consider allowing the user to specify a CUDA search path candidate via environment variable. This should allow transparently overriding preferred CUDA path without having to adjust all builds. I can't say I like it, but it seems to be the least bad way (that I can think of ATM) to address the dependency on something that only the end user would know for sure.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89974/new/

https://reviews.llvm.org/D89974



More information about the cfe-commits mailing list