Clang CUDA Support Failing

Bug #1706326 reported by Axel Huebl
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
clang (Ubuntu)
Invalid
Undecided
Unassigned
nvidia-cuda-toolkit (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi,

clang 3.9+ supports compiling CUDA C++ files (.cu):
  http://llvm.org/docs/CompileCudaWithLLVM.html#prerequisites

I installed the packages
  - clang-3.9
  - nvidia-cuda-toolkit (8.0)

on Ubuntu 16.04 (via the latest docker image: ubuntu:16.04).

My example file is just any .cu file, e.g. this one:
  https://github.com/ax3l/cpp_snippets/blob/master/cuda_mandelbrot/mandelbrot.cu

If I now run
  clang++ main.cu

or
  clang++ --cuda-path=/usr main.cu

I get the error

  clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.

This is the same bug as reported upstream in
  https://bugs.llvm.org/show_bug.cgi?id=26966

due to the "scattered install" of CUDA in Debian/Ubuntu.

Is there a way to fix this from the packaging side?

Tags: clang cuda
Axel Huebl (axel-huebl)
summary: - CUDA Support Failing
+ Clang CUDA Support Failing
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-cuda-toolkit - 8.0.61-3

---------------
nvidia-cuda-toolkit (8.0.61-3) unstable; urgency=medium

  * Use dpkg makefile snippets instead of manual changelog parsing.
  * Add monolithic cuda tree shim in /usr/lib/cuda/.
    Use for 'clang++ --cuda-path=/usr/lib/cuda'. (LP: #1706326)
  * Update Lintian overrides.

 -- Andreas Beckmann <email address hidden> Thu, 23 Nov 2017 05:23:45 +0100

Changed in nvidia-cuda-toolkit (Ubuntu):
status: New → Fix Released
Revision history for this message
Axel Huebl (axel-huebl) wrote :

Thank you, that's a great solution! :)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in clang (Ubuntu):
status: New → Confirmed
Graham Inggs (ginggs)
Changed in clang (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Axel Huebl (axel-huebl) wrote :

I'm not sure if invalid is the correct resolution status but the issue was solved now in the nvidia-cuda-toolkit package. It now installs CUDA in a monolithic path.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.