Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require 'cudnn' error #279

Closed
sunwooOh opened this issue Oct 20, 2016 · 15 comments
Closed

require 'cudnn' error #279

sunwooOh opened this issue Oct 20, 2016 · 15 comments

Comments

@sunwooOh
Copy link

Hi all.
When I run require cudnn(in one of my files load_caffe.lua, line 3), this kind of error is raised:

/home/sunwoo/torch/install/bin/luajit: /home/sunwoo/torch/install/share/lua/5.1/trepl/init.lua:384: /home/sunwoo/torch/install/share/lua/5.1/cudnn/init.lua:71: attempt to call field 'hasFastHalfInstructions' (a nil value)
stack traceback:
[C]: in function 'error'
/home/sunwoo/torch/install/share/lua/5.1/trepl/init.lua:384: in function 'require'
load_caffe.lua:3: in main chunk
[C]: in function 'dofile'
...nwoo/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

I've installed cuDNN 7.5, luarocks install'ed all nn, cudnn, torch again, but problem's not solved.
What do you think is the matter?

Thank you.

@soumith
Copy link
Owner

soumith commented Oct 20, 2016

updating cutorch will fix this.

@v1993
Copy link

v1993 commented Oct 21, 2016

I've got last version of cutorch and cudnn.torch (cudnn version 5, CUDA 8.0), lua 5.2, but I've got the same bug.

/home/v/.luarocks/share/lua/5.2/trepl/init.lua:501: in function </home/v/.luarocks/share/lua/5.2/trepl/init.lua:494>
[C]: in function 'error'
/home/v/.luarocks/share/lua/5.2/trepl/init.lua:384: in function 'require'
/home/v/.lua/onstart.lua:19: in function 'loadmod'
[string "_RESULT={loadmod 'cudnn'}"]:1: in main chunk
[C]: in function 'xpcall'
/home/v/.luarocks/share/lua/5.2/trepl/init.lua:652: in function 'repl'
/home/v/.luarocks/lib/luarocks/rocks/trepl/scm-1/bin/th:197: in main chunk
[C]: in ?

@soumith
Copy link
Owner

soumith commented Oct 21, 2016

hi @v1993 . this error is definitely because of a non updated cutorch.

Maybe what is happening is that you have another cutorch on your system somewhere you dont expect.

@sunwooOh
Copy link
Author

Now works perfectly.
Thank you @soumith.

@Lyken17
Copy link

Lyken17 commented Oct 31, 2016

Works for me
Thank you @soumith

@shimen
Copy link

shimen commented Nov 9, 2016

Hi,
when I use the last commit I get:
th> require('cudnn')
/usr/local/share/lua/5.1/trepl/init.lua:389: /usr/local/share/lua/5.1/cudnn/init.lua:98: attempt to call field 'hasFastHalfInstructions' (a nil value)
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/trepl/init.lua:389: in function 'require'
[string "_RESULT={require('cudnn')}"]:1: in main chunk
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/trepl/init.lua:661: in function 'repl'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x004054a0
[6.6986s]

@ngimel
Copy link
Collaborator

ngimel commented Nov 9, 2016

You need to update cutorch

@soumith soumith closed this as completed Nov 9, 2016
@shimen
Copy link

shimen commented Nov 10, 2016

I had made a full torch install after using clean-old.sh to clean all the old versions.
I had installed it with:
luarocks install cutorch
luarocks install cunn
luarocks install cudnn

When I run the command: luajit -lcutorch
I get:
ilyas@s29.black.bionic8.com ~$ luajit -lcutorch
luajit: /usr/local/share/lua/5.1/cutorch/init.lua:2: cannot load '/usr/local/lib/lua/5.1/libcutorch.so'
stack traceback:
[C]: in function 'require'
/usr/local/share/lua/5.1/cutorch/init.lua:2: in main chunk
[C]: at 0x0044cfb0
[C]: at 0x004054a0

When I install cutorch with this command: luarocks install cutorch 1.0-0
I get:
ilyas@s29.black.bionic8.com ~$ luajit -lcutorch
LuaJIT 2.1.0-beta1 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/

|_ | | |
| | ___ _ __ | |
| |/ _ | '/ | '
| | () | | | (| | | |
/__/|| __|| ||

JIT: ON SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse

#####################################################
so I made this install:
luarocks install cutorch 1.0-0
luarocks install cunn 1.0-0
luarocks install cudnn

now I get the error:
ilyas@s29.black.bionic8.com ~$ luajit -lcudnn
luajit: /usr/local/share/lua/5.1/cudnn/init.lua:98: attempt to call field 'hasFastHalfInstructions' (a nil value)
stack traceback:
/usr/local/share/lua/5.1/cudnn/init.lua:98: in function 'fasterHalfMathTypeForCurrentDevice'
/usr/local/share/lua/5.1/cudnn/init.lua:112: in function 'configureMath'
/usr/local/share/lua/5.1/cudnn/init.lua:131: in main chunk
[C]: at 0x0044cfb0
[C]: at 0x004054a0

after removing cudnn: luarocks remove cudnn

I had installed it with:
git clone https://github.com/soumith/cudnn.torch -b R5
cd cudnn.torch
luarocks make
cd ../

now it works, but it is not stable.

@ngimel
Copy link
Collaborator

ngimel commented Nov 10, 2016

do you have to use cutorch 1.0-0? Your problem would be solved if you used latest cutorch (luarocks install cutorch).

@shimen
Copy link

shimen commented Nov 10, 2016

i had tried to install the latest versions, like this:
luarocks remove cutorch
luarocks remove cunn
luarocks remove cudnn

luarocks install cutorch
luarocks install cunn
luarocks install cudnn

Then I get an error from cutorch

@borisfom
Copy link
Contributor

@shimen, you need to check your luarocks config if it gets cutorch from standard place.
This works:

luarocks install cutorch
Installing https://raw.githubusercontent.com/torch/rocks/master/cutorch-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/cutorch-scm-1.rockspec... switching to 'build' mode
Cloning into 'cutorch'...
remote: Counting objects: 206, done.
remote: Compressing objects: 100% (162/162), done.
remote: Total 206 (delta 59), reused 81 (delta 42), pack-reused 0
Receiving objects: 100% (206/206), 196.08 KiB | 0 bytes/s, done.
Resolving deltas: 100% (59/59), done.
Checking connectivity... done.

@MojganMaddah
Copy link

I have the same problem. I could install neither cutorch nor cudnn.

@honeyaya
Copy link

honeyaya commented Jan 3, 2018

hello,
first I
"luarocks remove cutorch"
"luarocks remove cunn"
"luarocks remove cudnn"
and then
"luarocks install cutorch"
"luarocks install cunn"
"luarocks install cudnn"

and still the error

so , how to update cutorch to latest version ???
Thanks.

More, my error:
/usr/local/bin/luajit: /usr/local/share/lua/5.1/trepl/init.lua:389: /usr/local/share/lua/5.1/cudnn/init.lua:98: attempt to call field 'hasFastHalfInstructions' (a nil value)
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/trepl/init.lua:389: in function 'require'
train.lua:9: in main chunk
[C]: in function 'dofile'
/usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x004058f0

@wangweihb
Copy link

@soumith How to upgrade the cutorch? thanks

@StoneCypher
Copy link

Hi, I've manually uninstalled cutorch, cunn, cudnn, cleared the luarocks cache, reinstalled all three, and am still facing this issue

@ngimel @soumith - This should be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests