Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install cuda module fails to find cuda driver library

I'm trying to install Manuel Chakravarty's accelerate module, but having some trouble with the cuda dependency.

I have installed both the CUDA developer driver and the CUDA toolkit from nvidia. To wit:

ludflu@beefy ~/Downloads $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2011 NVIDIA Corporation
Built on Thu_Jan_12_14:41:45_PST_2012
Cuda compilation tools, release 4.1, V0.2.1221

installing the cuda cabal module fails like this:

cabal  install cuda
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/cuda-0.4.1.07892/cuda-0.4.1.0/Setup.hs, /tmp/cuda-0.4.1.07892/cuda-0.4.1.0/dist/setup/Main.o )
Linking /tmp/cuda-0.4.1.07892/cuda-0.4.1.0/dist/setup/setup ...
Configuring cuda-0.4.1.0...
...
checking for library containing cuDriverGetVersion... no
configure: error: could not find CUDA driver library
********************************************************************************

The configuration process failed to locate your CUDA installation. Ensure that
you have installed the driver and developer toolkit, available from:

  http://developer.nvidia.com/cuda-downloads

Then make sure that "nvcc" is available in your PATH, or set the appropriate
directories with --extra-include-dirs and --extra-lib-dirs.

********************************************************************************
cabal: Error: some packages failed to install:
cuda-0.4.1.0 failed during the configure step. The exception was:
ExitFailure 1

So I tried specifying the path:

cabal --extra-include-dirs=/usr/local/cuda/include --extra-lib-dirs=/usr/local/cuda/lib install cuda

But that fails the same way.

Any suggestions on what I should try next?

like image 720
nont Avatar asked Oct 08 '22 10:10

nont


1 Answers

This error usually indicates that configure was not able to find the CUDA library objects. Specifically, you probably have to set LD_LIBRARY_PATH in addition to using --extra-include_dirs and --extra-lib-dirs. Try the following,

env LD_LIBRARY_PATH=/usr/local/cuda/lib cabal --extra-include-dirs=/usr/local/cuda/include --extra-lib-dirs=/usr/local/cuda/lib install cuda

You didn't specify which system you are using. If you are in a 64-bit Linux system, you may have to use /usr/local/cuda/lib64 instead of /usr/local/cuda/lib.

like image 169
Manuel Chakravarty Avatar answered Oct 13 '22 10:10

Manuel Chakravarty