python - Python 停止切换到 GPU 上下文
问题描述
我正在尝试在 AWS 上设置我的机器学习环境,如下所示:-
OS: windows server 2012 r2 , 64 bit
instance: p2.xlarge
GPU : Tesla K80 series
CUDA: 9.2.148
Graphis driver: 398.26 (installed by cuda toolkit)
python : 3.5 ( tested using 2.7.15 as well) ,64 bit
IDE: Pycharm Community 2018.2, 64 bit
mxnet librabry: mxnet-cu92
现在当我运行以下代码时:
import mxnet as mx
from mxnet import nd
mx.random.seed(1)
z = nd.ones(shape=(3,3), ctx=mx.cpu())
print(z)
它工作正常,但是当我更改ctx=mx.gpu() 或 ctx=mx.gpu(0)时,我得到错误 python 停止工作。
cuda 设置工作正常我编译并运行了deviceQuery
示例bandwidthTest
应用程序,这些都按预期提供了输出。
编辑:: python 崩溃详细信息给了我以下信息:
Fault Module Name: ucrtbase.DLL
我尝试使用 Cuda Graphis 驱动程序:398.44(从 cuda 网站为我的 gpu 和 os 推荐)到目前为止仍然没有运气。
有解决这个问题的想法吗?
解决方案
花了将近 3 天后终于得到了解决方案,是 mxnet 库导致了问题。在尝试了不同的 cuda 工具包和 mxnet 库之后,以下组合对我有用:-
1) Cuda Toolkit - 9.2
Mxnet lbrary : mxnet-cu92 version 1.2.0b20180525
(Failing for most of the recent versions )
2) Cuda Toolkit - 8.0
Mxnet lbrary : mxnet-cu80 version 0.11.0
(Failing for most of the recent versions )
谢谢
推荐阅读
- c# - 在剃刀视图中为操作 URL 设置变量是一种好习惯吗?我可以把它们放在 ViewModel 中吗?
- oracle - 从 oracle 包中检索密码
- javascript - 幻灯片中的几个模态图像
- excel - 在第一次进入单元格时触发 MsgBox,对单元格的后续更改或单击不执行任何操作
- python - Python 3 中的 writerow 总是在原始行之间写一个空行,Python2 效果很好。为什么?
- go - Fabric GO SDK 的背书政策问题
- javascript - k6 - 带有 *.crt 文件的配置文件中的 tlsAuth
- sql - 使用 WITH 子句声明和使用变量
- javascript - 随机滚动到一个长度并单击列表中的可查看元素
- c# - 如何在 Visual Studio 安装项目的启动条件下检查 .Net Core 版本