创建PyOpenCl上下文会导致以后的访问冲突 [英] Creating PyOpenCl context causes later access violation

查看:156
本文介绍了创建PyOpenCl上下文会导致以后的访问冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用pyopencl尝试OpenCL.我是从这里得到的

I just started to experiment with OpenCL using pyopencl. I got it from here

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl

我编写了一些测试程序,执行工作按预期进行.比起我想开始进行大量仿真时,我因访问冲突而随机崩溃(Windows错误代码FFFFFFFFC0000005).事实证明,导入pyopencl并创建上下文的任何脚本在一到两分钟后都会崩溃.我进行了3次测试,并获得了[63sec,86sec,81sec].

I wrote some test programms and excecuting worked as expected. Than when I wanted to start a big batch of simulations I got random crashes with Access Violations (Windows Error Code FFFFFFFFC0000005) . It turns out that any script in which I import pyopencl and create a context crashes after one to two minute. I run 3 tests and got [63sec, 86sec, 81sec].

通过设置环境变量PYOPENCL_CTX = 1:0,我确保上下文始终在"Intel(R)HD Graphics 620"卡上.

I have ensured that the context is always on my 'Intel(R) HD Graphics 620' card by setting the environment variable PYOPENCL_CTX = 1:0

import pyopencl as cl
ctx = cl.create_some_context()

import time

i = 0
while True:
    print("Im alive since %i seconds" % i, flush = True)
    i += 1
    time.sleep(1.0)

我有一个来自Python.org的Python 3.7.2(tags/v3.7.2:9a3ffc0492,Dec 23 2018,23:09:28)[MSC v.1916 64位(AMD64)]

I have a Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] from python.org

在删除环境变量并仅让外壳位于选择平台对话框中(没有选择平台)后,由于访问冲突而在大约一分钟后崩溃.

After removing the environment variable and just letting the shell sit in the choose platform dialog - wihtout choosing a platform - crashes after about a minute with Access Violation.

我将Driver Vesion更新为最新的可用版本22.20.16.4771(从2017年8月13日开始),但是问题仍然存在.

I updated the Driver Vesion to the latest available 22.20.16.4771 (from 13/08/2017) but the problem persists.

推荐答案

这可能是由于驱动程序过时造成的.在计算机供应商不提供最新驱动程序的情况下,即使不能保证兼容性,也可以使用Intel的通用驱动程序.

This may be due to outdated driver. In the case that the computer vendor does not provide up-to-date drivers a generic driver from Intel may work, eventhough there is no guarantee of compatibility.

英特尔仅提供驱动程序作为自安装.exe,当它注意到该驱动程序的自定义版本正在运行时,不允许安装驱动程序.

Intel only provides driver as self installing .exe which don't allow driver installation when it notices that a custom version of there drivers is running.

但是,可以通过使自解压.exe不受限制来规避此检查.从它创建的temp文件夹中复制数据,然后使用widnows设备管理器手动安装这些驱动程序.不用说,这很容易破坏设置.

However one can circumvent this check by letting the self uncompressing .exe uncrompess. Copy the data from the temp folder it creates and then manually install these drivers usind the widnows device manager. It goes without saying that this easily may break a setup.

这篇关于创建PyOpenCl上下文会导致以后的访问冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆