运行Bempp中Laplace_interior_dirichlet出现的问题

在运行Bempp的Laplace Interior Dirichlet示例时遇到编译警告和程序崩溃问题。通过设置环境变量`PYOPENCL_COMPILER_OUTPUT='1'`显示编译警告,发现是由于OpenCL设备选择和编译警告导致。通过指定`PYOPENCL_CTX='1'`选择OpenCL设备,成功解决了程序运行问题。
摘要由CSDN通过智能技术生成

运行Bempp例子出现的问题

​ 在运行bempp中的laplace_interior_Diriclet的例子时,出现了如下错误:

C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopencl\__init__.py:233: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
  "to see more.", CompilerWarning)
  • 解决方案:添加如下代码

    os.environ['PYOPENCL_COMPILER_OUTPUT'] = '1'
    

    添加上诉代码将编译警告输出后,如下:

C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopencl\__init__.py:229: CompilerWarning: Built kernel retrieved from cache. Original from-source build had warnings:
Build on <pyopencl.Device 'Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz' on 'Intel(R) OpenCL' at 0x1aef582e470> succeeded, but said:

Compilation started
Compilation done
Linking started
Linking done
Device build started
Device build done
Kernel <evaluate> was successfully vectorized (8)
Done.===========================================================================
Build on <pyopencl.Device 'Intel(R) HD Graphics 630' on 'Intel(R) OpenCL' at 0x1aef98e2620> succeeded, but said:

fcl build 1 succeeded.
bcl build succeeded.

  warn(text, CompilerWarning)
C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\pyopencl\__init__.py:229: CompilerWarning: From-binary build succeeded, but resulted in non-empty logs:
Build on <pyopencl.Device 'Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz' on 'Intel(R) OpenCL' at 0x1aef582e470> succeeded, but said:

Device build started
Device build done
Reload Program Binary Object.
  warn(text, CompilerWarning)

Process finished with exit code -1073741819 (0xC0000005)

​ 程序似乎运行到此处就停止运行了,这个问题困扰了我一天,一直在排查原因所在,突然想到在命令行执行代码时需要选择opencl的运行设备。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wMS3BWhe-1622100879566)(C:\Users\lenovo\AppData\Roaming\Typora\typora-user-images\image-20210527151800508.png)]

  • 解决方案:添加如下代码

    os.environ['PYOPENCL_CTX'] = '1'
    

`python
os.environ[‘PYOPENCL_CTX’] = ‘1’




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值