Closed tigerneil closed 7 years ago
Can you successfully use chainer with gpu, say https://github.com/pfnet/chainer/blob/master/examples/mnist/train_mnist.py with -g 0
?
(py2env) neil@DESKTOP-C22605O:~$ python train_mnist.py -g 0
GPU: 0
# unit: 1000
# Minibatch-size: 100
# epoch: 20
Traceback (most recent call last):
File "train_mnist.py", line 133, in <module>
main()
File "train_mnist.py", line 70, in main
chainer.cuda.get_device(args.gpu).use() # Make a specified GPU current
File "cupy/cuda/device.pyx", line 75, in cupy.cuda.device.Device.use (cupy/cuda/device.cpp:2083)
File "cupy/cuda/device.pyx", line 81, in cupy.cuda.device.Device.use (cupy/cuda/device.cpp:2035)
File "cupy/cuda/runtime.pyx", line 178, in cupy.cuda.runtime.setDevice (cupy/cuda/runtime.cpp:2915)
File "cupy/cuda/runtime.pyx", line 130, in cupy.cuda.runtime.check_status (cupy/cuda/runtime.cpp:2241)
cupy.cuda.runtime.CUDARuntimeError: cudaErrorUnknown: unknown error
This is the result in ipython
In [2]: import chainer
In [3]: from chainer import cuda, Function, gradient_check, report, training, utils, Variable
In [4]: from chainer import datasets, iterators, optimizers, serializers
In [5]: from chainer import Link, Chain, ChainList
In [6]: import chainer.functions as F
In [7]: import chainer.links as L
In [8]: from chainer.training import extensions
In [9]: x_data = np.array([5], dtype=np.float32)
In [10]: x = Va
ValueError Variable
In [10]: x = Variable(x_data)
In [11]: y = x ** 2 - 2*x + 1
In [12]: y.data
Out[12]: array([ 16.], dtype=float32)
In [13]: y.backward()
---------------------------------------------------------------------------
CUDARuntimeError Traceback (most recent call last)
<ipython-input-13-95acac9c3254> in <module>()
----> 1 y.backward()
/home/neil/py2env/lib/python2.7/site-packages/chainer/variable.pyc in backward(self, retain_grad)
355 if cuda.available:
356 try:
--> 357 initial_device = cuda.Device()
358 except cuda.cupy.cuda.runtime.CUDARuntimeError as e:
359 if e.status != 38: # cudaErrorNoDevice
/home/neil/py2env/lib/python2.7/site-packages/cupy/cuda/device.so in cupy.cuda.device.Device.__init__ (cupy/cuda/device.cpp:1596)()
/home/neil/py2env/lib/python2.7/site-packages/cupy/cuda/runtime.so in cupy.cuda.runtime.getDevice (cupy/cuda/runtime.cpp:2562)()
/home/neil/py2env/lib/python2.7/site-packages/cupy/cuda/runtime.so in cupy.cuda.runtime.check_status (cupy/cuda/runtime.cpp:2241)()
CUDARuntimeError: cudaErrorUnknown: unknown error
It seems like you failed to install chainer or cuda. Did you successfully install cuda? Did you follow https://github.com/pfnet/chainer#installation-with-cuda when installing chainer?
it seems like bash for windows is not good. I can't make gpu driver work well. I will check it later. Close it first. Thanks.
recently I got a windows 10 computer, successfully installed bash on ubuntu for windows, cuda, cudnn, chainer and chainerrl. But to run the example, I got the following error. Any suggestions?
(py2env) neil@DESKTOP-C22605O:~/chainerrl$ xvfb-run -s "-screen 0 1400x900x24" python examples/gym/train_dqn_gym.py Output files are saved in dqn_out/20170324141722891586 INFO:gym.envs.registration:Making new env: Pendulum-v0 Traceback (most recent call last): File "examples/gym/train_dqn_gym.py", line 179, in
main()
File "examples/gym/train_dqn_gym.py", line 154, in main
episodic_update=args.episodic_replay, episodic_update_len=16)
File "/home/neil/py2env/local/lib/python2.7/site-packages/chainerrl/agents/dqn.py", line 115, in init
cuda.get_device(gpu).use()
File "cupy/cuda/device.pyx", line 75, in cupy.cuda.device.Device.use (cupy/cuda/device.cpp:2083)
File "cupy/cuda/device.pyx", line 81, in cupy.cuda.device.Device.use (cupy/cuda/device.cpp:2035)
File "cupy/cuda/runtime.pyx", line 178, in cupy.cuda.runtime.setDevice (cupy/cuda/runtime.cpp:2915)
File "cupy/cuda/runtime.pyx", line 130, in cupy.cuda.runtime.check_status (cupy/cuda/runtime.cpp:2241)
cupy.cuda.runtime.CUDARuntimeError: cudaErrorUnknown: unknown error