python3.5+pycuda installzation + pytools no file or directory "nvcc"

step0~step3 follow the instruction in https://wiki.tiker.net/PyCuda/Installation/Linux/Ubuntu

step4 (for python3.5):  $sudo apt-get install build-essential python3-dev python3-setuptools libboost-python-dev libboost-thread-dev

                                    Download PyCUDA and unpack it:   $tar xzvf pycuda-VERSION.tar.gz

                                    $cd pycuda-VERSION

                                    $  ./configure.py --python-exe=/usr/bin/python3 --cuda-root=/usr/local/cuda --cudadrv-lib-dir=/usr/lib/x86_64-linux-gnu --boost-inc-dir=/usr/include --boost-lib-dir=/usr/lib --boost-python-libname=boost_python-py35 --boost-thread-libname=boost_thread --no-use-shipped-boost

                                    $  make -j 4

                                    $ sudo python3 setup.py install

step5 (test installzation): $ cd examples/

                                       $ python3 demo.py


如果在运行使用到pycuda时,出现 找不到nvcc的问题,但是,在终端通过 nvcc -V 或者 which nvcc可以找到nvcc的相关信息时,我采用以下方法解决了此问题:

sudo gedit /etc/enviroment,   将所安装的cuda8.0的路径(我的是   usr/local/cuda-8.0/bin)加到path后面,重启机器!


testing output is :  

original array:
[[-0.73402965  0.27021709  0.02252972 -0.13197117]
 [ 0.33812249  0.486314   -1.02830327 -0.07789359]
 [ 0.75662965  0.6742726  -0.92978919 -0.70925355]
 [-1.74797106  1.41699934  0.33079711 -1.71537197]]
doubled with kernel:
[[-1.4680593   0.54043418  0.04505945 -0.26394233]
 [ 0.67624497  0.972628   -2.05660653 -0.15578718]
 [ 1.51325929  1.34854519 -1.85957837 -1.4185071 ]
 [-3.49594212  2.83399868  0.66159421 -3.43074393]]
doubled with InOut:
[[-1.4680593   0.54043418  0.04505945 -0.26394233]
 [ 0.67624497  0.972628   -2.05660653 -0.15578718]
 [ 1.51325929  1.34854519 -1.85957837 -1.4185071 ]
 [-3.49594212  2.83399868  0.66159421 -3.43074393]]
original array:
[[-0.05362955  0.38353631  1.14744794  2.10718703]
 [-0.49023584  0.39153752  0.37595326 -0.50278574]
 [-0.20742868 -0.29073218 -0.43260652 -0.75614166]
 [ 0.73224729 -0.35651347 -0.74725002 -1.64894199]]
doubled with gpuarray:
[[-0.10725911  0.76707262  2.29489589  4.21437407]
 [-0.98047167  0.78307503  0.75190651 -1.00557148]
 [-0.41485736 -0.58146435 -0.86521304 -1.51228333]
 [ 1.46449459 -0.71302694 -1.49450004 -3.29788399]]
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值