[PATCH] D108247: [CUDA] Improve CUDA version detection and diagnostics.

Raul Tambre via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 26 09:33:36 PDT 2021


tambre added a comment.

This unfortunately breaks <https://open.cdash.org/viewTest.php?onlyfailed&buildid=7478510> using Debian distribution CUDA.
The Debian/Ubuntu special case <https://github.com/llvm/llvm-project/blob/8cf93a35d4b873b5e50c152d00adfc3701c679ea/clang/lib/Driver/ToolChains/Cuda.cpp#L167> is now useless.

On Debian:

- `cuda.h` is in `/usr/include`, as it must be per policy.
- `libdevice.10.bc` is in `/usr/lib/cuda/nvidia-cuda-toolkit/libdevice` and `/usr/lib/cuda/nvvm/libdevice` is symlinked to that.

Passing `--cuda-path=/usr/lib/cuda` previously worked, but now results in trying to parse from `/usr/lib/cuda/include/cuda.h` (doesn't exist) and Clang defaulting to the newest available version, which isn't supported by the `ptxas` currently in Debian.
NVCC has no issues with this layout.

Symlinking `/usr/lib/cuda/include` to `/usr/include` on Debian's side seems like the obvious short-term solution for trunk.
Could probably be backported to ensure LTSes will work with Clang 14.

If any thoughts for an alternative solution let me know.
I have filed Debian bug #TODO.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108247



More information about the cfe-commits mailing list