运行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’