libdevice library not found by nvcc

Hi, I just set up a CUDA 6.5 environment under Ubuntu 14.04. I’m trying to compile a very simple cuda program for a device with compute capability 3.5 (GTX Titan). Unfortunately, I can’t get nvcc to compile successfully for any architecture above 1.3 (i.e. it works for 1.3, but not 2.0, 3.0, 3.5).

When I run “nvcc test.cu -arch=sm_35” it throws the error:

nvcc fatal : path to libdevice library not specified

My LD_LIBRARY_PATH environment variable includes $CUDA_ROOT/nvvm/libdevice, so I’m mystified why nvcc is unable to find libdevice.compute_35.10.bc in this directory.

Compilation for 3.5 succeeds when I explicitly point nvcc to the appropriate library via “-ldir=$CUDA_ROOT/nvvm/libdevice”

HOWEVER, I know that if my CUDA environment were configured correctly, I wouldn’t need to pass this command-line argument. Does anyone know what’s wrong? Do I need to set an additional environment variable?

I’m hoping there is an easy fix for this problem, and would appreciate some assistance!

Thanks,

-David

Did you install cuda 6.5 via repository method or runfile method?

I installed using the runfile method.

Does anyone know how to configure nvcc.profile to get around this problem?

(I suspect the problem stems from nvcc.profile in $CUDA_ROOT/bin, because the only way I’ve been able to compile successfully is by passing --dont-use-profile as a command line parameter to nvcc, as described above.)

Here’s what my nvcc.profile looks like:

TOP = $(HERE)/…

NVVMIR_LIBRARY_DIR = $(TOP)/nvvm/libdevice

LD_LIBRARY_PATH += (TOP)/lib: PATH += (TOP)/open64/bin:(TOP)/nvvm/bin:(HERE):

INCLUDES += "-I$(TOP)/(_TARGET_DIR_)/include" (SPACE)

LIBRARIES =+ (_SPACE_) "-L(TOP)/(_TARGET_DIR_)/lib(TARGET_SIZE)/stubs" “-L$(TOP)/(_TARGET_DIR_)/lib(TARGET_SIZE)”

CUDAFE_FLAGS +=
OPENCC_FLAGS +=
PTXAS_FLAGS +=

Note: I tried setting TOP = /usr/local/cuda to force all of these environment variables to point to the correct locations, but this didn’t solve my problem.

Any thoughts?

You shouldn’t have to modify the nvcc.profile file. That is not normal. CUDA 6.5 should be properly supported on Ubuntu 14.04 and things should just work. Did you install to the default directories? Did you follow the instructions in the linux getting started guide, including setting PATH and LD_LIBRARY_PATH env. variables?

Thanks. I wiped my installation and reinstalled using the deb method in the getting started guide. Everything works great now.