nont
nont

Reputation: 9519

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?

Upvotes: 5

Views: 5779

Answers (3)

Siddharth
Siddharth

Reputation: 9574

To build as libary

Right Click->Properties->Build->Setting-Build Artifact->Dropdown to choose Shared/Static library

Difference between Shared / Static library

Now to include this library, copy the library to the project you want it and put it in a libs folder at the same level as the src level. Note, I am assuming that you have a src folder.

On this project

Right Click->Properties->Build->Setting->Libraries->

  • in the -l area add name of library without the prefix lib and without the suffix .so

  • in the -L area add ../libs, remember its 2 dots since the current folder is src, not the root of the project :) YEAH, I tried ./libs for 1 hours before trying out ../libs

Upvotes: -1

user328062
user328062

Reputation:

The answer didn't work for me on Ubuntu 13.10 but the following did (seems to depend strongly on how the nvidia driver was installed, in my case via the nvidia-319 package)

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

of course YMMV and ideally the installer would be modified to look in places where the cuda libraries should be.

Upvotes: 1

Manuel Chakravarty
Manuel Chakravarty

Reputation: 166

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.

Upvotes: 4

Related Questions