前提・実現したいこと
chainerでgpuを使用したプログラムを動作させたいですが、
以下のエラーメッセージが発生しました。
プログラムを正しく動作させるための方法を教えてください
よろしくお願いします
###使用したコード
http://www.ie110704.net/2017/06/20/chainer%E3%81%A7%E3%83%8B%E3%83%A5%E3%83%BC%E3%83%A9%E3%83%AB%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC%E3%82%AF%E3%80%81rnn%E3%80%81cnn%E3%82%92%E5%AE%9F%E8%A3%85%E3%81%97%E3%81%A6%E3%81%BF/
こちらのサイトのコードのx_をnumpy.arrayからcuda.cupy.arrayに変更しました
発生している問題・エラーメッセージ
<ipython-input-4-edf0f08c70be> in __call__(self, x, t, train) 26 if train: 27 t = Variable(t) ---> 28 h = F.sigmoid(self.xh(x)).data 29 h = self.hh(h) 30 h = self.xx0(h) /usr/local/lib/python2.7/dist-packages/chainer/links/connection/linear.pyc in __call__(self, x) 90 with cuda.get_device(self._device_id): 91 self._initialize_params(x.size // x.shape[0]) ---> 92 return linear.linear(x, self.W, self.b) /usr/local/lib/python2.7/dist-packages/chainer/functions/connection/linear.pyc in linear(x, W, b) 77 return LinearFunction()(x, W) 78 else: ---> 79 return LinearFunction()(x, W, b) /usr/local/lib/python2.7/dist-packages/chainer/function.pyc in __call__(self, *inputs) 197 # Forward prop 198 with cuda.get_device(*in_data): --> 199 outputs = self.forward(in_data) 200 assert type(outputs) == tuple 201 for hook in six.itervalues(hooks): /usr/local/lib/python2.7/dist-packages/chainer/functions/connection/linear.pyc in forward(self, inputs) 37 if len(inputs) == 3: 38 b = inputs[2] ---> 39 y += b 40 return y, 41 cupy/core/core.pyx in cupy.core.core.ndarray.__iadd__ (cupy/core/core.cpp:22285)() cupy/core/elementwise.pxi in cupy.core.core.ufunc.__call__ (cupy/core/core.cpp:45418)() cupy/util.pyx in cupy.util.memoize.decorator.ret (cupy/util.cpp:1283)() cupy/core/elementwise.pxi in cupy.core.core._get_ufunc_kernel (cupy/core/core.cpp:41888)() cupy/core/elementwise.pxi in cupy.core.core._get_simple_elementwise_kernel (cupy/core/core.cpp:32088)() cupy/core/carray.pxi in cupy.core.core.compile_with_cache (cupy/core/core.cpp:31743)() /usr/local/lib/python2.7/dist-packages/cupy/cuda/compiler.pyc in compile_with_cache(source, options, arch, cache_dir) 150 else: 151 lock.release() --> 152 cubin = nvcc(source, options, arch) 153 lock.acquire() 154 with open(path, 'wb') as cubin_file: /usr/local/lib/python2.7/dist-packages/cupy/cuda/compiler.pyc in nvcc(source, options, arch) 76 77 cmd.append(cu_path) ---> 78 _run_nvcc(cmd, root_dir) 79 80 with open(cubin_path, 'rb') as bin_file: /usr/local/lib/python2.7/dist-packages/cupy/cuda/compiler.pyc in _run_nvcc(cmd, cwd) 54 'stdout/stderr: \n' 55 '{2}'.format(e.cmd, e.returncode, e.output)) ---> 56 raise RuntimeError(msg) 57 except OSError as e: 58 msg = 'Failed to run `nvcc` command. ' \ RuntimeError: `nvcc` command returns non-zero exit status. command: ['nvcc', '--cubin', '-arch', 'sm_61', '/tmp/tmp4q7Z_H/kern.cu'] return-code: 1 stdout/stderr: nvcc fatal : Value 'sm_61' is not defined for option 'gpu-architecture'
補足情報
gpuはGTX1070
ubuntu 16.04
python 2.7.12
cuda 8.0.61
cudnn 5.1
nvidia driver 384.145
エラーメッセージ中の
nvcc --cubin -arch=sm_61 /tmp/tmp4q7Z_H/kern.cu
をターミナル上で実行するとなぜかエラーもなく実行できた
同プログラムは別のコンピュータでは動作したため、プログラム自体に不備はないと思います
私のユーザはsudoersになく、再インストール・アップデート等は不可能です
管理者に問い合わせても諸事情により再インストール・アップデート等は行えないと回答されました
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/02 10:12
2018/07/04 05:18