RGCN on GPU getting error

Hi all,

I’m trying to run RGCN code in on GPU. I get the following error:
self.propagate(g)
File “/mnt/home/bahare/main_sample/dgl/examples/pytorch/rgcn/layers.py”, line 100, in propagate
g.update_all(msg_func, fn.sum(msg=‘msg’, out=‘h’), None)
File “/opt/conda/lib/python3.6/site-packages/dgl/graph.py”, line 2753, in update_all
Runtime.run(prog)
File “/opt/conda/lib/python3.6/site-packages/dgl/runtime/runtime.py”, line 11, in run
exe.run()
File “/opt/conda/lib/python3.6/site-packages/dgl/runtime/ir/executor.py”, line 1191, in run
graph = self.graph.data(ctx)
File “/opt/conda/lib/python3.6/site-packages/dgl/utils.py”, line 451, in wrapper
dic[key] = func(self, *args)
File “/opt/conda/lib/python3.6/site-packages/dgl/graph_index.py”, line 622, in get_immutable_gidx
return self.to_immutable().asbits(self.bits_needed()).copy_to(ctx)
File “/opt/conda/lib/python3.6/site-packages/dgl/graph_index.py”, line 835, in copy_to
handle = _CAPI_DGLImmutableGraphCopyTo(self._handle, ctx.device_type, ctx.device_id)
File “/opt/conda/lib/python3.6/site-packages/dgl/_ffi/_ctypes/function.py”, line 175, in call
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File “/opt/conda/lib/python3.6/site-packages/dgl/_ffi/base.py”, line 62, in check_call
raise DGLError(py_str(_LIB.DGLGetLastError()))
dgl._ffi.base.DGLError: [14:50:10] /opt/dgl/src/runtime/c_runtime_api.cc:87: Check failed: allow_missing Device API gpu is not enabled.

Stack trace returned 10 entries:
[bt] (0) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dmlc::StackTrace()+0x19d) [0x7f7bea975e2d]
[bt] (1) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x18) [0x7f7bea976c88]
[bt] (2) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dgl::runtime::DeviceAPIManager::GetAPI(std::string, bool)+0x8d3) [0x7f7beaf6abe3]
[bt] (3) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dgl::runtime::DeviceAPI::Get(DLContext, bool)+0x174) [0x7f7beaf66324]
[bt] (4) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dgl::runtime::NDArray::Empty(std::vector<long, std::allocator >, DLDataType, DLContext)+0x26e) [0x7f7beaf8bd8e]
[bt] (5) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dgl::runtime::NDArray::CopyTo(DLContext const&) const+0xb7) [0x7f7beafc8057]
[bt] (6) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dgl::CSR::CopyTo(DLContext const&) const+0x84) [0x7f7beafc0364]
[bt] (7) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(dgl::ImmutableGraph::CopyTo(DLContext const&) const+0x5d) [0x7f7beafc387d]
[bt] (8) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(+0x89e14f) [0x7f7beafaf14f]
[bt] (9) /opt/conda/lib/python3.6/site-packages/dgl/libdgl.so(DGLFuncCall+0x52) [0x7f7beaf68b22]

Is there any part I’m missing?

Hi, could you please share the following information so that we can try to reproduce the error:

  • The dgl version you are using

  • The exact command you used to run the program.

It seems you didn’t install the dgl with cuda support. How do you install it, by source or pip/conda?

Yes, I had dgl installed without cuda enabled.
Thanks! I resolved it with installing the right dgl.

Hi, I have the same problem like yours.
However, my cuda’s version is 10.1 and there’s no dgl for 10.1.
I downloaded dgl for 10.0, and it didn’t work of course.
So what should I deal with it?

Hi,

Could you try installing from source as guide here? We would try to add cuda10.1 binary in the future.