yandex / faster-rnnlm

Faster Recurrent Neural Network Language Modeling Toolkit with Noise Contrastive Estimation and Hierarchical Softmax
Other
561 stars 138 forks source link

NCE Error: Compiled without CUDA support #23

Closed sameerkhurana10 closed 8 years ago

sameerkhurana10 commented 8 years ago

Hi,

While running the below command:

./rnnlm -rnnlm model_name -train train.txt -valid validation.txt -hidden 128 -hidden-type gru -nce 20 -alpha 0.01 -use-cuda 1

I get the following error:

Constructing NCE: layer_size=128, maxent_hash_size=0, cuda=1, ln(Z)=9.000000 NCE error: Compiled without CUDA support!

How to compile with CUDA support?

I have CUDA 7.5 on the machine and have been running other programs on GPU successfully.

$LD_LIBRARY_PATH bash: :/usr/local/cuda/lib64

$CUDA_HOME bash: /usr/local/cuda: Is a directory

sameerkhurana10 commented 8 years ago

Command Line output of the command ./build.sh:

Downloading Eigen library --2016-05-22 01:24:53-- http://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2 Resolving bitbucket.org (bitbucket.org)... 104.192.143.2, 104.192.143.1, 104.192.143.3 Connecting to bitbucket.org (bitbucket.org)|104.192.143.2|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2 [following] --2016-05-22 01:24:53-- https://bitbucket.org/eigen/eigen/get/3.2.4.tar.bz2 Connecting to bitbucket.org (bitbucket.org)|104.192.143.2|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1147976 (1.1M) [application/x-bzip-compressed-tar] Saving to: ‘eigen.3.2.4.tar.bz2’

100%[==================================================================================================================>] 1,147,976 1.34MB/s in 0.8s

2016-05-22 01:24:54 (1.34 MB/s) - ‘eigen.3.2.4.tar.bz2’ saved [1147976/1147976]

‘eigen-eigen-10219c95fe65’ -> ‘eigen3’ g++ rnnlm.cc -c -o rnnlm.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ hierarchical_softmax.cc -c -o hierarchical_softmax.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ nce.cc -c -o nce.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ words.cc -c -o words.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ maxent.cc -c -o maxent.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ nnet.cc -c -o nnet.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ layers/simple_layer.cc -c -o layers/simple_layer.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ layers/gru_layer.cc -c -o layers/gru_layer.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ layers/scrn_layer.cc -c -o layers/scrn_layer.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ layers/layer_stack.cc -c -o layers/layer_stack.o -Wall -march=native -funroll-loops -g -DSTDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ layers/interface.cc -c -o layers/interface.o -Wall -march=native -funroll-loops -g -D__STDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA g++ rnnlm.o hierarchical_softmax.o nce.o words.o maxent.o nnet.o layers/simple_layer.o layers/gru_layer.o layers/scrn_layer.o layers/layer_stack.o layers/interface.o -o rnnlm -Wall -march=native -funroll-loops -g -D__STDC_FORMAT_MACROS -I../ -DEIGEN_DONT_PARALLELIZE -Ofast -pthread -DNOCUDA -lm -lstdc++ -lrt

akhti commented 8 years ago

Hey,

Unfortunately the path to cuda is hardcoded. And cuda is expected to be install from .run file.

In your case you need just to chage path here: https://github.com/yandex/faster-rnnlm/blob/master/faster-rnnlm/Makefile#L18

Make sure that nvcc in your path, i.e. the following works: which nvcc

sameerkhurana10 commented 8 years ago

I see, thanks.