[go: up one dir, main page]

LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 26966 - RFE: Scattered --cuda-path in Linux Distributions
Summary: RFE: Scattered --cuda-path in Linux Distributions
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: CUDA (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-16 13:11 PDT by Axel Huebl
Modified: 2021-09-17 02:28 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Huebl 2016-03-16 13:11:56 PDT
Hi,

installing CUDA on a Ubuntu or Debian machine from contrib/non-free/multiverse will lead to a "scattered" CUDA a bit different from what the Nvidia installer creates.

For Debian 8.0 "Jessie", the provided "contrib" CUDA 6.0 looks like this:

/usr/bin/nvcc
/usr/include/cuda.h
/usr/lib/x86_64-linux-gnu/libcuda.so
/usr/lib/x86_64-linux-gnu/libcudart.so
[...]

Details:
  https://packages.debian.org/jessie/amd64/nvidia-cuda-dev/filelist
  https://packages.debian.org/jessie/amd64/nvidia-cuda-toolkit/filelist

Trying to compile a .cu file with clang++ --cuda-path=/usr does not get recognised as a valid install. It would be great if such install paths would be supported, too.

(Created on request, see http://lists.llvm.org/pipermail/cfe-dev/2016-March/047994.html)
Comment 1 Vedran Miletic 2016-03-26 16:01:35 PDT
This would be great to support.
Comment 2 Artem Belevich 2016-03-28 16:26:04 PDT
CUDA 6.0 is quite a few releases out of date and is probably not going to be supported.

As for detection of CUDA installation integrated with host headers/libraries, it should be doable.
Comment 3 Vedran Miletic 2016-03-28 16:30:14 PDT
There is 6.5 in Debian stable backports: https://tracker.debian.org/pkg/nvidia-cuda-toolkit

Anyhow, split CUDA support would be useful.
Comment 4 Axel Huebl 2016-03-29 02:09:49 PDT
Yes, it's also not so much about the fact that it is an old version of
CUDA (which it will always be in Debian).

The report is about the system-specific install path that will probably
stay this way with 6.5, 7.0, 7.5, ...
Comment 5 Axel Huebl 2017-07-25 05:33:32 PDT
Hi,

the problem is still an issue and quite a problem for distributed CUDA and Clang versions.

I reported the issue also in Ubuntu in
  https://bugs.launchpad.net/ubuntu/+source/clang/+bug/1706326
and cross-linked here.

Is it possible to make the CUDA install detection in clang a bit more flexible, e.g. by allowing to provide a
  --cuda-include-path
  --cuda-library-path

prefix?
The --cuda-path option used today could then just set both to the same value as a convenience switch.

What are the exact components that need to be fund by clang? Only the cuda headers and libcuda.so + libcudart.so?
Comment 6 Artem Belevich 2017-10-27 15:18:33 PDT
@Axel

It's possible to add all those flags, but I'm not sure it's worth it. If/when clang needs to use something else from the CUDA SDK, we'll need another flag and that would break all current users. IMO, it would be easier/better to re-create original CUDA directory structure in one place using symlinks to point to the bits and pieces of CUDA SDK as installed on your system. This way compiler can rely on the same directory structure everywhere and the packaging/installation of CUDA on particular system can do whatever it wants. 

E.g:

/usr/local/cuda-8.0 -> /usr/share/cuda-8.0-shim
/usr/share/cuda-8.0-shim:
  lib64 -> /usr/lib64
  includes -> /usr/include (or just symlink CUDA headers)
  bin -> /usr/bin
  nvvm/libdevice -> wherever/libdevice/is
  version.txt -> wherever/is/the/real/version.txt (or just echo 8.0.0 into it)
Comment 7 Artem Belevich 2017-11-27 15:22:37 PST
Looks like such a shim package is coming for Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882505
Comment 8 Axel Huebl 2020-03-25 10:38:02 PDT
Yes, I reported this upstream as well: https://bugs.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+bug/1706326