利用cugraph中的minimum_spanning_tree算法时出现terminate called after throwing an instance of ‘raftcuda_error‘

在加速最小生成树算法时,运行cugraph.tree.minimum_spanning_tree时遇到下面问题:

terminate called after throwing an instance of 'raftcuda_error'
  what()  CUDA error encountered at file=optcondaenvsrapidsincluderafthandle.hpp line=270 call='cudaEventDestroy(event_)', Reason=cudaErrorIll                                                                egalAddressan illegal memory access was encountered
Obtained 33 stack frames
#0 in optcondaenvsrapidslibpython3.7site-packagescugraphtreeminimum_spanning_tree_wrapper.cpython-37m-x86_64-linux-gnu.so(_ZN4raft9exception18                                                                collect_call_stackEv+0x3b) [0x7f74c1690f7b]
#1 in optcondaenvsrapidslibpython3.7site-packagescugraphtreeminimum_spanning_tree_wrapper.cpython-37m-x86_64-linux-gnu.so(_ZN4raft10cuda_error                                                                C1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xbd) [0x7f74c169172d]
#2 in optcondaenvsrapidslibpython3.7site-packagescugraphtreeminimum_spanning_tree_wrapper.cpython-37m-x86_64-linux-gnu.so(_ZN4raft8handle_t17d                                                                estroy_resourcesEv+0x4b5) [0x7f74c169ac75]
#3 in optcondaenvsrapidslibpython3.7site-packagescugraphtreeminimum_spanning_tree_wrapper.cpython-37m-x86_64-linux-gnu.so(+0x492d5) [0x7f74c16                                                                892d5]
#4 in python(PyCFunction_Call+0x33f) [0x556459e21d5f]
#5 in optcondaenvsrapidslibpython3.7site-packagescugraphtreeminimum_spanning_tree_wrapper.cpython-37m-x86_64-linux-gnu.so(+0x2c636) [0x7f74c16                                                                6c636]
#6 in optcondaenvsrapidslibpython3.7site-packagescugraphtreeminimum_spanning_tree_wrapper.cpython-37m-x86_64-linux-gnu.so(+0x359c3) [0x7f74c16                                                                759c3]
#7 in python(_PyMethodDef_RawFastCallKeywords+0x143) [0x556459eaf353]
#8 in python(+0x18fad8) [0x556459eb0ad8]
#9 in python(_PyEval_EvalFrameDefault+0x4c0a) [0x556459edb74a]
#10 in python(_PyFunction_FastCallKeywords+0x184) [0x556459e4ce94]
#11 in python(+0x18f9c8) [0x556459eb09c8]
#12 in python(_PyEval_EvalFrameDefault+0x96c) [0x556459ed74ac]
#13 in python(_PyEval_EvalCodeWithName+0x242) [0x556459e1eaf2]
#14 in python(_PyFunction_FastCallKeywords+0x320) [0x556459e4d030]
#15 in python(+0x18f9c8) [0x556459eb09c8]
#16 in python(_PyEval_EvalFrameDefault+0x4c0a) [0x556459edb74a]
#17 in python(_PyFunction_FastCallKeywords+0x184) [0x556459e4ce94]
#18 in python(+0x18f9c8) [0x556459eb09c8]
#19 in python(_PyEval_EvalFrameDefault+0x4c0a) [0x556459edb74a]
#20 in python(_PyFunction_FastCallKeywords+0x184) [0x556459e4ce94]
#21 in python(+0x18f9c8) [0x556459eb09c8]
#22 in python(_PyEval_EvalFrameDefault+0x96c) [0x556459ed74ac]
#23 in python(_PyEval_EvalCodeWithName+0x242) [0x556459e1eaf2]
#24 in python(PyEval_EvalCodeEx+0x39) [0x556459e1fd09]
#25 in python(PyEval_EvalCode+0x1b) [0x556459efa8ab]
#26 in python(+0x23df53) [0x556459f5ef53]
#27 in python(PyRun_FileExFlags+0x97) [0x556459f68fd7]
#28 in python(PyRun_SimpleFileExFlags+0x19c) [0x556459f691ac]
#29 in python(+0x248709) [0x556459f69709]
#30 in python(_Py_UnixMain+0x3c) [0x556459f6985c]
#31 in libx86_64-linux-gnulibc.so.6(__libc_start_main+0xe7) [0x7f76caff0bf7]
#32 in python(+0x1c5901) [0x556459ee6901]

Aborted (core dumped)

找了半天都没找到解决办法,最后发现是由于cugraph只能支持边权重为floa64类型,也就是weight的类型得是np.float64,如果是float32就会报错。有趣的是,networkx生成的图class的边权重好像默认是float32,所以会报错。建议用cugraph的形式构件图,并提前把邻接矩阵转化为np.float64。需要注意的一点是,minimum_spanning_tree需要指定第二个参数weight,官方文档里说如果不指定就默认设置为1。有一个比较奇怪的地方是官方文档中说它用来加速的’boruvka’算法是并行算法,求得到的是近似最优解,但是我在网上看到的也没说是Prim、kruskal的近似解,所以想问问有了解并行boruvka算法细节的大佬,这里存在这样的问题吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值