DeepMind-Atari-Deep-Q-Learner icon indicating copy to clipboard operation
DeepMind-Atari-Deep-Q-Learner copied to clipboard

run_gpu: module 'cutorch' not found

Open 190n opened this issue 10 years ago • 13 comments

When I try to run a game on the GPU, I get the following output:

$ ./run_gpu breakout
-framework alewrap -game_path /home/ben/Downloads/DeepMind-Atari-Deep-Q-Learner-master/roms/ -name DQN3_0_1_breakout_FULL_Y -env breakout -env_params useRGB=true -agent NeuralQLearner -agent_params lr=0.00025,ep=1,ep_end=0.1,ep_endt=replay_memory,discount=0.99,hist_len=4,learn_start=50000,replay_memory=1000000,update_freq=4,n_replay=1,network="convnet_atari3",preproc="net_downsample_2x_full_y",state_dim=7056,minibatch_size=32,rescale_r=1,ncols=1,bufferSize=512,valid_size=500,target_q=10000,clip_delta=1,min_reward=-1,max_reward=1 -steps 50000000 -eval_freq 250000 -eval_steps 125000 -prog_freq 10000 -save_freq 125000 -actrep 4 -gpu 0 -random_starts 30 -pool_frms type="max",size=2 -seed 1 -threads 4
Fontconfig error: "/home/ben/.config/font-manager/local.conf", line 2: syntax error
Gtk-Message: Failed to load module "canberra-gtk-module"
Torch Threads:  4
qlua: ./initenv.lua:58: module 'cutorch' not found:
    no field package.preload['cutorch']
    no file './cutorch.lua'
    no file '/home/ben/Downloads/DeepMind-Atari-Deep-Q-Learner-master/torch/share/luajit-2.0.3/cutorch.lua'
    no file '/usr/local/share/lua/5.1/cutorch.lua'
    no file '/usr/local/share/lua/5.1/cutorch/init.lua'
    no file '/home/ben/Downloads/DeepMind-Atari-Deep-Q-Learner-master/torch/share/lua/5.1/cutorch.lua'
    no file '/home/ben/Downloads/DeepMind-Atari-Deep-Q-Learner-master/torch/share/lua/5.1/cutorch/init.lua'
    no file './cutorch.so'
    no file '/usr/local/lib/lua/5.1/cutorch.so'
    no file '/home/ben/Downloads/DeepMind-Atari-Deep-Q-Learner-master/torch/lib/lua/5.1/cutorch.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: at 0x7f0b12f8d7b0
    [C]: in function 'require'
    ./initenv.lua:58: in function 'torchSetup'
    ./initenv.lua:112: in function 'setup'
    train_agent.lua:52: in main chunk

190n avatar Aug 30 '15 15:08 190n

This is probably because you do not have nVidia CUDA toolkit installed.

  • Go through the http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux
  • Check that which nvcc returns the location of nvcc executable
  • run ./install_dependecies.sh again

kuz avatar Aug 30 '15 17:08 kuz

Thanks. Trying that now...

190n avatar Aug 30 '15 19:08 190n

Still doesn't work.

190n avatar Aug 30 '15 20:08 190n

Problem is that luarocks install cunn and luarocks install cutorch failed on your system. (Same as on mine with ubuntu 15.10 / CUDA 7.5 ) will try to find a workaround.

--- Update --- Problem was i did not had the same version for the c compiler and for the c++ compiler. Second problem was i the g++ symlink in /usr/bin/ was missing after installing gcc/g++ 4.9

to build the packages this did work for me:

apt-get install g++-4.9 gcc-4.9 rm -rf /usr/bin/gcc rm -rf /usr/bin/g++ ln -s /usr/bin/g++-4.9 /usr/bin/g++ ln -s /usr/bin/gcc-4.9 /usr/bin/gcc

now execute the install dependencies.sh again

Then if you are using a server that does commandline only open the file %yourDQN%/dqn/train_agent.lua

comment out (--) line 98 to not use X11 So that it looks like this: -- win =image.display({image=screen, win=win})

Hope this helps you

snapo avatar Feb 05 '16 11:02 snapo

I am having the same issue despite running both g++ and gcc with the same version (4.8.2. in my case).

drsstein avatar Feb 10 '16 16:02 drsstein

I have the same problem in Ubuntu 14.04. Cutorch is already installed.

qlua: ./initenv.lua:58: module 'cutorch' not found: no field package.preload['cutorch'] no file './cutorch.lua' no file '/home/mehmet/Desktop/DeepMind-Atari-Deep-Q-Learner-master/torch/share/luajit-2.0.4/cutorch.lua' no file '/usr/local/share/lua/5.1/cutorch.lua' no file '/usr/local/share/lua/5.1/cutorch/init.lua' no file '/home/mehmet/Desktop/DeepMind-Atari-Deep-Q-Learner-master/torch/share/lua/5.1/cutorch.lua' no file '/home/mehmet/Desktop/DeepMind-Atari-Deep-Q-Learner-master/torch/share/lua/5.1/cutorch/init.lua' no file './cutorch.so' no file '/usr/local/lib/lua/5.1/cutorch.so' no file '/home/mehmet/Desktop/DeepMind-Atari-Deep-Q-Learner-master/torch/lib/lua/5.1/cutorch.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: at 0x7feabae9f9f0 [C]: in function 'require' ./initenv.lua:58: in function 'torchSetup' ./initenv.lua:112: in function 'setup' train_agent.lua:52: in main chunk

Cutorch is in;

cutorch scm-1 is now built and installed in /home/mehmet/torch/install/ (license: BSD)

How can i make it find cutorch?

mhmtsarigul avatar Jun 02 '16 10:06 mhmtsarigul

Could you check your path variables (global and user) if you have added the cutorch path from your system?

snapo avatar Jun 03 '16 10:06 snapo

Thanks for your answer. I remove torch and cutorch then i install them again maybe five times. But at the end it works. There was a version problem i think because lua 5.1 comes with torch but the application looks for 5.2.

2016-06-03 13:50 GMT+03:00 snapo [email protected]:

Could you check your path variables (global and user) if you have added the cutorch path from your system?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kuz/DeepMind-Atari-Deep-Q-Learner/issues/5#issuecomment-223549331, or mute the thread https://github.com/notifications/unsubscribe/ASxuXL1o10BTgfHiefEcW9Ed1Zm3cTGJks5qIAcOgaJpZM4F0ra- .

mhmtsarigul avatar Jun 09 '16 13:06 mhmtsarigul

@kuz I finally solved the issue passing two weeks of agony. Thanks! I think 190n didn't just follow the instruction correctly. He should have modified the path and LD_LIBRARY_PATH. 190n, you can check whether your installation completed by running samples specified in step 6-2

jsrimr avatar Jul 29 '17 06:07 jsrimr

@190n Have you resolved your problem yet? Cuz I'm having the same issue.

gaohaoyue avatar Aug 23 '17 20:08 gaohaoyue

@kuz What are path and LD_LIBRARY_PATH have you modified?

gaohaoyue avatar Aug 23 '17 20:08 gaohaoyue

@gaohaoyue I lost interest :/

190n avatar Aug 25 '17 03:08 190n

I had the same problem. The following solution worked for me:

apt-get install g++-4.8 gcc-4.8 rm -rf /usr/bin/gcc rm -rf /usr/bin/g++ ln -s /usr/bin/g++-4.8 /usr/bin/g++ ln -s /usr/bin/gcc-4.8 /usr/bin/gcc

now execute the install dependencies.sh again

ghost avatar Nov 21 '17 10:11 ghost