Device API cuda is not enabled


Traceback (most recent call last):
File “/home/vishakbhat/vig/graph_gpu.py”, line 20, in
g_gpu = g.to(device)
File “/home/vishakbhat/.local/lib/python3.10/site-packages/dgl/heterograph.py”, line 5709, in to
ret._graph = self._graph.copy_to(utils.to_dgl_context(device))
File “/home/vishakbhat/.local/lib/python3.10/site-packages/dgl/heterograph_index.py”, line 255, in copy_to
return _CAPI_DGLHeteroCopyTo(self, ctx.device_type, ctx.device_id)
File “dgl/_ffi/_cython/./function.pxi”, line 295, in dgl._ffi._cy3.core.FunctionBase.call
File “dgl/_ffi/_cython/./function.pxi”, line 227, in dgl._ffi._cy3.core.FuncCall
File “dgl/_ffi/_cython/./function.pxi”, line 217, in dgl._ffi._cy3.core.FuncCall3
dgl._ffi.base.DGLError: [16:47:48] /opt/dgl/src/runtime/c_runtime_api.cc:82: Check failed: allow_missing: Device API cuda is not enabled. Please install the cuda version of dgl.
Stack trace:
[bt] (0) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x75) [0x7ff44c93e8f5]
[bt] (1) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dgl::runtime::DeviceAPIManager::GetAPI(std::string, bool)+0x202) [0x7ff44ccada92]
[bt] (2) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dgl::runtime::DeviceAPI::Get(DGLContext, bool)+0x1e1) [0x7ff44ccaa071]
[bt] (3) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dgl::runtime::NDArray::Empty(std::vector<long, std::allocator >, DGLDataType, DGLContext)+0x13b) [0x7ff44ccc554b]
[bt] (4) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dgl::runtime::NDArray::CopyTo(DGLContext const&) const+0xc3) [0x7ff44ccffd53]
[bt] (5) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dgl::UnitGraph::CopyTo(std::shared_ptrdgl::BaseHeteroGraph, DGLContext const&)+0x3ff) [0x7ff44ce0d24f]
[bt] (6) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(dgl::HeteroGraph::CopyTo(std::shared_ptrdgl::BaseHeteroGraph, DGLContext const&)+0xf6) [0x7ff44cd0c5d6]
[bt] (7) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(+0x51b396) [0x7ff44cd1b396]
[bt] (8) /home/vishakbhat/.local/lib/python3.10/site-packages/dgl/libdgl.so(DGLFuncCall+0x48) [0x7ff44cca92a8]

When i am trying to do
g.to(device)
I am getting this error
I tried uninstalling and tried installing dgl-cu100 etc but that installation dint work

please help me with this problem

I suggest referring to the DGL installation guide here: Deep Graph Library. Earlier versions can also be accessed through DGL Team Channel or by specifying the CUDA version URL (e.g., for CUDA 11.3): https://data.dgl.ai/wheels/cu113/repo.html for further information.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.