Device API cuda is not enabled. Please install the cuda version of dgl

As the title says, my CUDA version is 11.7, and the Pytroch version is 1.13.1. Using pytorch’s torch.cuda.is_available() function returns True, but when I use pytorch to prepare to use the GPU, this error is prompted:
dgl._ffi.base.DGLError: [07:40:24] /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.
After I tried to delete dgl (and use import dgl to confirm that the moudle has not been found), I reinstalled the dgl corresponding to the cuda version (ie 11.7) on the official website, but still prompted the above error.
How should I solve this problem? Thanks a lot for your answers!

What was your command to install DGL? The error looks like you installed a CPU version of DGL.

I use the installation command from the official website:
pip install dgl -f https://data.dgl.ai/wheels/cu117/repo.html

could you check whether cuda enabled DGL is really installed? pip3 list|grep dgl

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