Windows 上的 Theano + Cuda 8.0 - 编译错误

     2023-02-23     286

关键词:

【中文标题】Windows 上的 Theano + Cuda 8.0 - 编译错误【英文标题】:Theano + Cuda 8.0 on Windows - Compile Errors 【发布时间】:2016-06-16 22:02:03 【问题描述】:

我让 Theano 在 Windows 10 没有 GPU 支持的情况下正常工作。我有一个新的 GTX 1080,想在上面运行 Theano。这需要来自 NVIDIA 的最新 CUDA 8.0 Toolkit。我已经根据http://deeplearning.net/software/theano/install_windows.html 安装了所有东西,允许一些小的软件版本差异。每当我尝试通过 .theanorc.txt 启用 GPU 支持的情况下简单地“导入 theano”时,都会出现编译错误。

Cuda 8.0 可以与 Theano-master 一起正常工作,根据此线程:https://github.com/Theano/Theano/issues/4558

从 6 月 16 日开始运行 WinPython 64bit 2.7.10.3、scipy 0.161、numpy 1.9.3、Microsoft Visual Studio 12.0 和 theano-master。

最近的尝试导致此错误列表:

===============================
C:/Users/CHARLE~1/AppData/Local/Temp/tmpxft_00001148_00000000-10_mod.cpp1.ii(1): error: this declaration has no storage class or type specifier

C:/Users/CHARLE~1/AppData/Local/Temp/tmpxft_00001148_00000000-10_mod.cpp1.ii(1): error: identifier "R" is undefined

C:/Users/CHARLE~1/AppData/Local/Temp/tmpxft_00001148_00000000-10_mod.cpp1.ii(1): error: expected a ";"

At end of source: warning: parsing restarts here after previous syntax error

3 errors detected in the compilation of "C:/Users/CHARLE~1/AppData/Local/Temp/tmpxft_00001148_00000000-10_mod.cpp1.ii".
mod.cu

['nvcc', '-shared', '-O3', '-arch=sm_61', '--compiler-bindir', 'C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\lc.exe', '-Xlinker', '/DEBUG', '-D HAVE_ROUND', '-m64', '-Xcompiler', '-DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD', '-IC:\\Users\\Charles Gillespie\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_63_Stepping_2_GenuineIntel-2.7.10-64\\cuda_ndarray', '-IC:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\include', '-IC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\numpy\\core\\include', '-IC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\include', '-Ic:\\scisoft\\winpython-64bit-2.7.10.3\\python-2.7.10.amd64\\theano\\theano\\gof', '-Ic:\\scisoft\\winpython-64bit-2.7.10.3\\python-2.7.10.amd64\\theano\\theano\\sandbox\\cuda', '-o', 'C:\\Users\\Charles Gillespie\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_63_Stepping_2_GenuineIntel-2.7.10-64\\tmp6qa5py\\4894639462a290346189bb38dab7bb7e.pyd', 'mod.cu', '-LC:\\Users\\Charles Gillespie\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_63_Stepping_2_GenuineIntel-2.7.10-64\\cuda_ndarray', '-LC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\libs', '-LC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64', '-lcudart', '-lcublas', '-lcuda_ndarray', '-lpython27']
Traceback (most recent call last):
  File "test-theano.py", line 3, in <module>
    import theano
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\__init__.py", line 118, in <module>
    theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1()
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\sandbox\cuda\tests\test_driver.py", line 32, in test_nvidia_driver1
    profile=False)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\compile\function.py", line 322, in function
    output_keys=output_keys)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\compile\pfunc.py", line 480, in pfunc
    output_keys=output_keys)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\compile\function_module.py", line 1784, in orig_function
    defaults)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\compile\function_module.py", line 1648, in create
    input_storage=input_storage_lists, storage_map=storage_map)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\link.py", line 693, in make_thunk
    storage_map=storage_map)[:3]
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\vm.py", line 1034, in make_all
    no_recycling))
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\sandbox\cuda\__init__.py", line 256, in make_thunk
    compute_map, no_recycling)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\op.py", line 969, in make_thunk
    no_recycling)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\op.py", line 872, in make_c_thunk
    output_storage=node_output_storage)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\cc.py", line 1200, in make_thunk
    keep_lock=keep_lock)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\cc.py", line 1143, in __compile__
    keep_lock=keep_lock)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\cc.py", line 1591, in cthunk_factory
    key=key, lnk=self, keep_lock=keep_lock)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\cmodule.py", line 1145, in module_from_key
    module = lnk.compile_cmodule(location)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\gof\cc.py", line 1502, in compile_cmodule
    preargs=preargs)
  File "c:\scisoft\winpython-64bit-2.7.10.3\python-2.7.10.amd64\theano\theano\sandbox\cuda\nvcc_compiler.py", line 403, in compile_str
    'for cmd', ' '.join(cmd))
Exception: ('The following error happened while compiling the node', GpuCAReduceadd1(<CudaNdarrayType(float32, vector)>), '\n', 'nvcc return status', 2, 'for cmd', 'nvcc -shared -O3 -arch=sm_61 --compiler-bindir C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\lc.exe -Xlinker /DEBUG -D HAVE_ROUND -m64 -Xcompiler -DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD -IC:\\Users\\Charles Gillespie\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_63_Stepping_2_GenuineIntel-2.7.10-64\\cuda_ndarray -IC:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v8.0\\include -IC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\numpy\\core\\include -IC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\include -Ic:\\scisoft\\winpython-64bit-2.7.10.3\\python-2.7.10.amd64\\theano\\theano\\gof -Ic:\\scisoft\\winpython-64bit-2.7.10.3\\python-2.7.10.amd64\\theano\\theano\\sandbox\\cuda -o C:\\Users\\Charles Gillespie\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_63_Stepping_2_GenuineIntel-2.7.10-64\\tmp6qa5py\\4894639462a290346189bb38dab7bb7e.pyd mod.cu -LC:\\Users\\Charles Gillespie\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_63_Stepping_2_GenuineIntel-2.7.10-64\\cuda_ndarray -LC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\libs -LC:\\scisoft\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64 -lcudart -lcublas -lcuda_ndarray -lpython27', '[GpuCAReduceadd1(<CudaNdarrayType(float32, vector)>)]')

请帮忙!

【问题讨论】:

【参考方案1】:

CUDA 8 RC 和 Visual Studio 2015 Update 2 (VC12) 及更高版本不能混合。您必须等到 NVidia 整合并发布更新或卸载 VC12 并安装 VC11。你应该很高兴。

【讨论】:

如何在 Windows 7 64 位上使用 theano 设置 cuDnn

】如何在Windows764位上使用theano设置cuDnn【英文标题】:howtosetupcuDnnwiththeanoonWindows764bit【发布时间】:2016-07-1420:51:33【问题描述】:我已经在我的机器上安装了Theano框架并启用了CUDA,但是当我在我的python控制台中“导入theano”时... 查看详情

Windows10 + Ubuntu 20.04 上的 CUDA 问题 [关闭]

】Windows10+Ubuntu20.04上的CUDA问题[关闭]【英文标题】:ProblemswithCUDAonWindows10+Ubuntu20.04[closed]【发布时间】:2020-11-1807:18:21【问题描述】:我有一台配备NvidiaGPU-MX250的笔记本电脑,我想编写和执行使用CUDA编写的代码。我在Windows10上安... 查看详情

Windows 上的 TensorFlow:“无法打开 CUDA 库 cudnn64_5.dll”

】Windows上的TensorFlow:“无法打开CUDA库cudnn64_5.dll”【英文标题】:TensorFlowonWindows:"Couldn\'topenCUDAlibrarycudnn64_5.dll"【发布时间】:2017-04-2119:05:31【问题描述】:Tensorflow刚刚发布了windows支持。我安装了gpu版本和CUDA8.0和python3.... 查看详情

Theano安装,nvcc不在路径中

...已经使用他们的指南http://deeplearning.net/software/theano/install_windows.html在winpython上的windows7,64bit上安装了theano,我认为它可以工作,因为当我运行他们的第一 查看详情

如何在 Windows 上的 Visual Studio 中编写 CUDA 并将其部署到 Linux?

】如何在Windows上的VisualStudio中编写CUDA并将其部署到Linux?【英文标题】:HowcanIwriteCUDAinVisualStudioonWindowsanddeployittoLinux?【发布时间】:2017-01-2611:42:24【问题描述】:我正在协助一位教授为并行编程课程建立实验室。流程如下:一... 查看详情

win10-anaconda2-theano-cuda7.5-vs2013

...win平台的限制,caffe用的不够舒服。因为之前用过一阵子theano,虽然很慢,但是灵活啊,于是又将矛头指向了theano。。theanocpu版本安装很容易,主流方法都是利用Anaconda,方便快捷。本文主要介绍自己搞gpu和其他人配置时的坑,... 查看详情

基于cuda的theanogpu加速环境配置gpu没有反应.求解答

参考技术A1.首先安装python,我选择安装Anaconda(Windows64-BitPython2.7GraphicalInstaller下载地址)。Anaconda的一些命令(在Anaconda的命令行窗口输入):condalist#该命令,将列出Anaconda安装的所有应用包,我们可以看到Anaconda已经安装了numpy,... 查看详情

theano-gpu坑:error(theano.gpuarray):couldnotinitializepygpu,supportdisabled

参考技术A运行一个较大的程序是,使用了theano-gpu。同时,使用nvidia-smi进行检测,发现这个大程序,的确调用gpu成功。但是,在使用import的时候,发现运行报错,报错信息如下。(1)有一个程序可以调用theano-gpu,则说明:在本... 查看详情

Azure DSVM 上的 Theano

】AzureDSVM上的Theano【英文标题】:TheanoonAzureDSVM【发布时间】:2017-06-1216:56:33【问题描述】:我正在尝试在AzureDSVM上使用Theano,它是用于数据科学的预配置VM。有人知道这样的虚拟机吗?它是否支持开箱即用的Theano?警告(theano.c... 查看详情

windows下tensorflow(gpu版)的安装(代码片段)

windows1064bit下安装Tensorflow+Keras+VS2015+CUDA8.0GPU加速0.环境OS:Windows10,64bit;显卡:NVIDIAGeForceGTX1050Ti,显卡查看方法:计算机【设备管理器】?【显示适配器】Python的版本,注意只能为3.5,并非越高越好;CUDA,8.0;keras可以以TensorFlow... 查看详情

手把手教你搭建深度学习平台——避坑安装theano+cuda

python有多混乱我就不多说了。这个混论不仅是指整个python市场混乱,更混乱的还有python的各种附加依赖包。为了一劳永逸解决python的各种依赖包对深度学习造成的影响,本文中采用python的发行版Anaconda。Step1安装Anaconda这里不建议... 查看详情

theano 安装 (windows 64bit python 2)

】theano安装(windows64bitpython2)【英文标题】:theanoinstallation(windows64bitpython2)【发布时间】:2015-05-0711:34:07【问题描述】:我开始安装theano。我的电脑规格:-操作系统:Windows764位-显卡:NVIDIAGeforceGT630-CPU:AMDFX-8120我通过deeplearning.net... 查看详情

ubunut16.04安装theano+gpu

...动,如下图     点击ApplyChanges2.安装numpy,scipy,theano  pip安装即可  sudopipinstall<packbage>3.安装Cuda7.5  sudoapt-getinstallnvidia-cuda-toolkit5.配置.theanorc??生成文件 查看详情

win10环境下安装theano并配置gpu详细教程

...16/12/23;(2)原材料VS2013,cuda-8.0(最好下载cuda7.5,目前theano-0.8.2对cuda-8支持不是很好),Anaconda3-4.2.0(64位);(3)环境为win10. 二.安装步骤(1)安装VS2013。这个没什么可说的,下载64位版本后就是一路下一步、确定就行... 查看详情

如何在 Windows 上配置 theano?

】如何在Windows上配置theano?【英文标题】:HowconfiguretheanoonWindows?【发布时间】:2015-03-1616:28:38【问题描述】:我已经在Windows机器上安装了Theano,并按照配置instructions。我将以下.theanorc.txt文件放在C:\\Users\\my_username文件夹中:#!sh... 查看详情

VMware 上的 cuda 程序

...在ubuntu上将其作为虚拟机进行测试。这样做的原因是我有windows7,我不想安装ubuntu作为辅助操作系统,我需要使用linux操作系统进行测试。我的问题是:虚拟机会限制GPU资源吗?那么如果我在主操作系统下运行cuda代码会比在虚拟... 查看详情

TF r2.3 Windows 上的错误地址构建问题

】TFr2.3Windows上的错误地址构建问题【英文标题】:TFr2.3BadAddressbuildissueonwindows【发布时间】:2021-01-0411:22:47【问题描述】:当我想构建一个支持CUDA的版本时,我在构建TFr2.3时遇到了问题。当我为没有CUDA的CPU配置构建时,一切都... 查看详情

在 Windows 7 上导入 Theano 时出现 g++ 错误

】在Windows7上导入Theano时出现g++错误【英文标题】:g++erroronimportofTheanoonWindows7【发布时间】:2016-11-2623:13:47【问题描述】:我正在尝试根据thetheanoinstallationguide使用正确的g++安装进行设置。我以前让theano使用仅python的实现。我在p... 查看详情