Cuda and Prop nodes

Hu I’m trying to get CUDA to work with DGL. Everything works fine until I get to prop nodes. I’ve checked and the graphs and features are registered to device CUDA:0, but I get the following error:

dgl_ffi.base.DGLError: expect argument “v” to have data type torch.int64 and device context cuda:0. But got torch.int64 and cpu.

I’m really confused with what’s going on, as said the graph and features are all on cuda:0. Any help would be really appreciated. The reduce function is a udf is that’s relevant.

Managed to fix it. In case anyone ever needs this, the issue was that the tensors for the traversal order return by dgl.topological_nodes_generator were still registered to the cpu and had to be sent to gpu.

1 Like