系统相关
首页 > 系统相关> > 使用Visual Studio 2013在Windows 8.1 64位上使用GPU安装Theano

使用Visual Studio 2013在Windows 8.1 64位上使用GPU安装Theano

作者:互联网

参见英文答案 > How do I install theano in Anaconda ver. 2.1 Windows 64 bit for Python 3.4?                                    3个
这个Theano安装让我很生气:(

所以,我按照这里最详尽答案的说明进行操作,因为它看起来像是我最相似的配置和最新版本:Installing theano on Windows 8 with GPU enabled

1-我已经安装了Cuda v6.5,启动了deviceQuery,它运行正常.

2-我已经安装了Visual Studio 2013,因此我没有安装Visual Studio 2010

3->在撰写本文时,GPU上的Theano仅允许使用32位浮点数,主要用于2.7版本的Python.

所以我现在还不知道现在的状态究竟是什么,但是我有一个配置与我相同的朋友,他设法让它工作,所以我想这是可能的.我已经通过Anaconda安装了Python.

4-我安装了MinGW和Cygwin

5-我修复了msvc9compiler.py

6-这是瓶颈:PyCUDA安装

这就是我所做的:
– 我用cygwin来提取pycuda tar文件
– 我已经通过VS2013 x64 Native Tools命令提示符执行了python configure.py,而不是配置的siteconfig.py,如下所示:

BOOST_INC_DIR = []
BOOST_LIB_DIR = []
BOOST_COMPILER = 'gcc43'
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python']
BOOST_THREAD_LIBNAME = ['boost_thread']
CUDA_TRACE = False
CUDA_ROOT = 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5'
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
CUDADRV_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib/x64']
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib/x64']
CUDART_LIBNAME = ['cudart']
CURAND_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib/x64']
CURAND_LIBNAME = ['curand']
CXXFLAGS = ['/EHsc', '-DBOOST_NO_TYPEID']
LDFLAGS = ['/FORCE']

>我通过VS2013 x64 Native Tools命令提示符执行了python setup.py build –compiler =“msvc”
>我通过VS2013 x64 Native Tools命令提示符执行了python setup.py安装
>当我在python中执行小测试时,这是正在发生的事情:

PS C:\users\jmm\desktop> python test.py

Vendor:  Continuum Analytics, Inc.

Package: mkl

Message: trial mode expires in 29 days

Traceback (most recent call last):

  File "test.py", line 7, in <module>
    a_doubled = (2*a_gpu).get()

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\gpuarray.py", line 471, in __rm
ul__
    return self._axpbz(scalar, 0, result)

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\gpuarray.py", line 333, in _axp
bz
    func = elementwise.get_axpbz_kernel(self.dtype, out.dtype)

  File "<string>", line 2, in get_axpbz_kernel

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\tools.py", line 423, in context
_dependent_memoize
    result = func(*args)

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\elementwise.py", line 417, in g
et_axpbz_kernel
    "axpb")

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\elementwise.py", line 157, in g
et_elwise_kernel
    arguments, operation, name, keep, options, **kwargs)

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\elementwise.py", line 143, in g
et_elwise_kernel_and_types
    keep, options, **kwargs)

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\elementwise.py", line 71, in ge
t_elwise_module
    options=options, keep=keep)
  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\compiler.py", line 251, in __in
it__
    arch, code, cache_dir, include_dirs)

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\compiler.py", line 241, in comp
ile
    return compile_plain(source, options, keep, nvcc, cache_dir)

  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\compiler.py", line 73, in compi
le_plain
    checksum.update(preprocess_source(source, options, nvcc).encode("utf-8"))
  File "C:\Users\jmm\Anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg\pycuda\compiler.py", line 52, in prepr
ocess_source
    cmdline, stderr=stderr)

pycuda.driver.CompileError: nvcc preprocessing of c:\users\jmm\appdata\local\temp\tmp32jnzb.cu failed
[command: nvcc --preprocess -arch sm_30 -m64 -Ic:\users\jmm\anaconda\lib\site-packages\pycuda-2014.1-py2.7-win-amd64.egg
\pycuda\cuda c:\users\jmm\appdata\local\temp\tmp32jnzb.cu --compiler-options -EP]
[stderr:
tmp32jnzb.cu
'C:\Program' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
]

你能告诉我为什么这不起作用吗?

解决方法:

我为整个过程写了一本实用指南:

https://my6266blog.wordpress.com/2015/01/21/installing-theano-pylearn2-and-even-gpu-on-windows/

祝好运!它并不复杂,只需按照步骤逐一进行.

标签:python,cuda,theano,pycuda
来源: https://codeday.me/bug/20190830/1765661.html