dynet: CMake error with "CUDA_cublas_device_LIBRARY"

Hello, Thanks for good library and developers.

I’m trying to install for C++. But, I get error messages when I type following command.

cmake .. -DEIGEN3_INCLUDE_DIR=/home/robot/opt/eigen3 -DENABLE_CPP_EXAMPLES=ON -DBACKEND=cuda -DCUDNN_ROOT=/usr/local/cuda 

And I get following error messages.

-- BACKEND: cuda
CUDA_LIBRARIES: /usr/local/cuda/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so;/usr/local/cuda/lib64/libcurand.so
-- Found CUDNN (include: /usr/local/cuda/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Successfully include CUDNN flags
-- Eigen dir is /home/robot/opt/eigen3
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_device_LIBRARY (ADVANCED)
    linked by target "dynet" in directory /home/robot/opt/dynet/dynet
    linked by target "1_linear_regression" in directory /home/robot/opt/dynet/tutorial
    linked by target "0_multiply" in directory /home/robot/opt/dynet/tutorial
    linked by target "xor-multidevice" in directory /home/robot/opt/dynet/examples
    linked by target "xor" in directory /home/robot/opt/dynet/examples
    linked by target "rnnlm-aevb" in directory /home/robot/opt/dynet/examples
    linked by target "fflm" in directory /home/robot/opt/dynet/examples
    linked by target "xor-batch" in directory /home/robot/opt/dynet/examples
    linked by target "imdb" in directory /home/robot/opt/dynet/examples
    linked by target "tok-embed" in directory /home/robot/opt/dynet/examples
    linked by target "rnnlm-batch" in directory /home/robot/opt/dynet/examples
    linked by target "embed-cl" in directory /home/robot/opt/dynet/examples
    linked by target "xor-autobatch" in directory /home/robot/opt/dynet/examples
    linked by target "mnist" in directory /home/robot/opt/dynet/examples
    linked by target "rnnlm-batch-nce" in directory /home/robot/opt/dynet/examples
    linked by target "rnn-autobatch" in directory /home/robot/opt/dynet/examples
    linked by target "poisson-regression" in directory /home/robot/opt/dynet/examples
    linked by target "read-write" in directory /home/robot/opt/dynet/examples
    linked by target "rnnlm" in directory /home/robot/opt/dynet/examples
    linked by target "attention" in directory /home/robot/opt/dynet/examples
    linked by target "encdec" in directory /home/robot/opt/dynet/examples
    linked by target "tag-bilstm" in directory /home/robot/opt/dynet/examples
    linked by target "rnnlm-cfsm" in directory /home/robot/opt/dynet/examples

-- Configuring incomplete, errors occurred!
See also "/home/robot/opt/dynet/build/CMakeFiles/CMakeOutput.log".
See also "/home/robot/opt/dynet/build/CMakeFiles/CMakeError.log".

More nvidia library is needed? I already installed cudnn and cuda tool kit.

By the way, my nvidia environment is as below.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.48                 Driver Version: 410.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0  On |                  N/A |
| 23%   28C    P8    12W / 250W |    287MiB / 11175MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1061      G   /usr/lib/xorg/Xorg                           180MiB |
|    0      1282      G   /usr/bin/gnome-shell                          98MiB |
|    0      1940      G   /usr/lib/firefox/firefox                       2MiB |
|    0      2191      G   /usr/lib/firefox/firefox                       2MiB |
+-----------------------------------------------------------------------------+

Please tell me how to solve this problem. Thanks in advance.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I also got the problem when I compiled caffe with the latest CUDA 10.0, and after upgrading CMake from 3.12.1 to 3.12.2 it’s done @harumo11

Confirmed: I had the same problem (Ubuntu 18.04, CUDA 10.0) and installing CMake 3.12.2 (instead of the distro’s 3.10.2) fixed it.

Hi, I have been facing similar error while installing Torch on my server. Cuda version - 11.0 CMake version - 3.18.2 Ubuntu version - 20.04 I see the above solutions work for CMake version >=3.12.2 Can someone please help with this. Thanks

-- Found Torch7 in /home/cs17btech11048/torch/install
-- Removing -DNDEBUG from compile flags
-- TH_LIBRARIES: TH
-- MAGMA not found. Compiling without MAGMA support
-- Autodetected CUDA architecture(s): 6.0 6.0
-- got cuda version 11.0
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -gencode;arch=compute_60,code=sm_60;-DCUDA_HAS_FP16=1
-- THC_SO_VERSION: 0
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_device_LIBRARY (ADVANCED)
    linked by target "THC" in directory /home/cs17btech11048/torch/extra/cutorch/lib/THC

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Error: Build error: Failed building.

I also got the problem when I compiled caffe with the latest CUDA 10.0, and after upgrading CMake from 3.12.1 to 3.12.2 it’s done @harumo11

This solved the issue for me too! thank you!