微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。