Ethash OpenCL 在“地图缓冲区”中中止

问题描述

我尝试在 Ethash 算法上使用 OpenCL 并重写它以在单个 cpp 文件中运行。我可以在新代码中以轻量模式和完整模式运行程序,但在 OpenCL 模式下我出现此错误

test@EDLV-3d567:/ethash/test$ g++ -o test test.cpp -O3 -lOpenCL
test@EDLV-3d567:/ethash/test$ ./test
ethash_mkcache: 542ms,sha3: 6a286c5fc0f36814732c86c3e71c036dd96d58def86b9244bb1480571e67d2a8
ethash_light test: 2ms,a7ea1de3a8007134900cd2c86f7e55af68a1d3e4537438a0a966b6cbafa23c90
Using platform: Portable Computing Language
Using device: pthread-Intel(R) Core(TM) i9-9900K cpu @ 3.60GHz
ethash_cl_miner init: 217636ms
terminate called after throwing an instance of 'cl::Error'
  what():  clEnqueueMapBuffer
Aborted
reza@DESKTOP-C97CAGD:/mnt/c/Users/rezaa/Desktop/ethash-23.1/ethash/test$

首先,我认为这是由于我的错误而发生的,但是当我在 Benchmark_CL 中运行主 ethash 项目(在 GitHub v23.1 上)时,我犯了同样的错误。 我查了一下,找到了这几行(git项目中的文件:ethash_cl_miner.cpp)。

// Could use pinned host pointer instead
uint32_t* results = (uint32_t*)m_queue.enqueueMapBuffer(m_search_buf[batch.buf],true,CL_MAP_READ,(1+c_max_search_results) * sizeof(uint32_t));
unsigned num_found = std::min(results[0],c_max_search_results);

谁能向我解释为什么会出现这个问题以及如何解决它。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)