win764位+NVIDIA Quadro 600+VS2010+anaconda+cuda5.5.20 成功配置使用GPU
2017-03-24 13:42
281 查看
本人电脑属性:
win7旗舰版 64位 12G内存 NVIDIA Quadro 600双显卡
安装步骤:
0、由于本人失败了n次,所以这次是刚装好系统的状态。
1、先安装VS2010,添加环境变量Path: C:\Program
Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;
2、在C盘安装anaconda,添加环境变量Path:C:\Anaconda\MinGW\bin;C:\Anaconda\MinGW\x86_64-w64-mingw32\lib;
重启电脑。注意:总的环境变量Path最后没有分号!
3、在http://download.csdn.net/detail/yeyang911/7523003 下载zip文件
,解压之后里面有theano 的文件夹,把theano文件夹放在C:/Anaconda/Lib/site-packages里面,新建环境变量:PYTHONPATH:
C:\Anaconda\Lib\site-packages\theano 注意:没有分号。在home目录下(cmd可以看到,我的是C:\Users\Administrator),创建(如已经存在则修改)
.theanorc.txt 文件内容如下(就是名字叫做.theanorc的文本文档,注意前面有个.):
保存。然后在Anaconda的Spyder命令行中里输入如下命令:
import theano
print theano.config.blas.ldflags
如果无显示则正常,说明theano安装成功。不成功则重新使用别的theano文件夹。
4、CUDA的配置:http://blog.csdn.net/yeyang911/article/details/17450963 完成之后为了使用GPU,我们要再次修改上面的
.theanorc.txt,将其中的内容改为:
保存,重启电脑。在cmd中运行python:
import theano
theano.test ( )
如果出现:会一直test吧反正没有error 就说明gpu成功
5、为了更确定成功使用gpu 在spyder中输入:
from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], T.exp(x))
print(f.maker.fgraph.toposort())
t0 = time.time()
for i in range(iters):
r = f()
t1 = time.time()
print("Looping %d times took %f seconds" % (iters, t1 - t0))
print("Result is %s" % (r,))
if numpy.any([isinstance(x.op, T.Elemwise) for x in f.maker.fgraph.toposort()]):
print('Used the cpu')
else:
print('Used the gpu')
如果出现[b]Used the gpu则成功使用gpu![/b]
总结:每个人情况不一样 使用的软件版本也不一样 大家多试试软件的版本 只要是英伟达的显卡通过gpuz软件测试支持cuda 的都可以配置gpu 的。
感谢参考:http://www.cnblogs.com/hanahimi/p/4127026.html
http://blog.csdn.net/yeyang911/article/details/17450963
win7旗舰版 64位 12G内存 NVIDIA Quadro 600双显卡
安装步骤:
0、由于本人失败了n次,所以这次是刚装好系统的状态。
1、先安装VS2010,添加环境变量Path: C:\Program
Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;
2、在C盘安装anaconda,添加环境变量Path:C:\Anaconda\MinGW\bin;C:\Anaconda\MinGW\x86_64-w64-mingw32\lib;
重启电脑。注意:总的环境变量Path最后没有分号!
3、在http://download.csdn.net/detail/yeyang911/7523003 下载zip文件
,解压之后里面有theano 的文件夹,把theano文件夹放在C:/Anaconda/Lib/site-packages里面,新建环境变量:PYTHONPATH:
C:\Anaconda\Lib\site-packages\theano 注意:没有分号。在home目录下(cmd可以看到,我的是C:\Users\Administrator),创建(如已经存在则修改)
.theanorc.txt 文件内容如下(就是名字叫做.theanorc的文本文档,注意前面有个.):
保存。然后在Anaconda的Spyder命令行中里输入如下命令:
import theano
print theano.config.blas.ldflags
如果无显示则正常,说明theano安装成功。不成功则重新使用别的theano文件夹。
4、CUDA的配置:http://blog.csdn.net/yeyang911/article/details/17450963 完成之后为了使用GPU,我们要再次修改上面的
.theanorc.txt,将其中的内容改为:
保存,重启电脑。在cmd中运行python:
import theano
theano.test ( )
如果出现:会一直test吧反正没有error 就说明gpu成功
5、为了更确定成功使用gpu 在spyder中输入:
from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], T.exp(x))
print(f.maker.fgraph.toposort())
t0 = time.time()
for i in range(iters):
r = f()
t1 = time.time()
print("Looping %d times took %f seconds" % (iters, t1 - t0))
print("Result is %s" % (r,))
if numpy.any([isinstance(x.op, T.Elemwise) for x in f.maker.fgraph.toposort()]):
print('Used the cpu')
else:
print('Used the gpu')
如果出现[b]Used the gpu则成功使用gpu![/b]
总结:每个人情况不一样 使用的软件版本也不一样 大家多试试软件的版本 只要是英伟达的显卡通过gpuz软件测试支持cuda 的都可以配置gpu 的。
感谢参考:http://www.cnblogs.com/hanahimi/p/4127026.html
http://blog.csdn.net/yeyang911/article/details/17450963
相关文章推荐
- 关于OpenCV Gpu模块无法使用Cuda4.2以上版本编译成功的解决方案
- 使用OpenCV的GPU模块(Win7x64+VS2010+OpenCV2.4.5+CUDA5.0)配置详解
- 使用OpenCV的GPU模块(Win7x64+VS2010+OpenCV2.4.5+CUDA5.0)配置详解
- 使用OpenCV的GPU模块(Win7x64+VS2010+OpenCV2.4.5+CUDA5.0)配置详解
- pytorch-0.2成功调用GPU:ubuntu16.04,Nvidia驱动安装以及最新cuda9.0与cudnnV7.0配置
- Tomcat5.5.20 使用JDBC 配置Mysql 5.0.22数据库连接池
- 使用Tomcat-5.5.20配置数据库连接池详细介绍
- GPU学习日记(一)------VS2010下如何配置CUDA4.2
- 成功使用squid+iptables配置透明代理 (zt)
- (CUDA 编程9).CUDA shared memory使用------GPU的革命
- (CUDA 编程8).CUDA 内存使用 global 二------GPU的革命
- 64位windows 7下成功配置TortoiseGit使用Github服务器
- VC6.0上成功编译ACE和使用ACE连接自己程序时候的手把手配置方案
- OpenSolaris0811中使用tar.gz成功安装配置mysql
- (自解)apache2.2 for winXP的安装与使用及IIS配置成功
- (CUDA 编程10).CUDA cosnstant使用(一)------GPU的革命
- 使用Tomcat-5.5.20配置数据库连接池详细介绍
- 9. CUDA shared memory使用------GPU的革命
- ubuntu10.04使用路由器上网成功配置(转载)
- 《GPU高性能编程-CUDA实战》中例子头文件使用