dgl icon indicating copy to clipboard operation
dgl copied to clipboard

DGL installs for CUDA support even when CUDA is set to none for Installation Instructions

Open wassimj opened this issue 2 years ago • 13 comments

🐛 Bug

I am following the official installation instructions for DGL with CUDA set to NONE as my laptop does not have CUDA. The resulting command is: pip install dgl -f https://data.dgl.ai/wheels/repo.html pip install dglgo -f https://data.dgl.ai/wheels-test/repo.html However, this command installs dgl with cuda (Successfully installed dgl-2.0.0+cu121) When I try to import DGL in python, I get the following error:

FileNotFoundError: Could not find module 'C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\dgl.dll' (or one of its dependencies). Try using the full path with constructor syntax.

To Reproduce

OS: Windows 11 Python: 3.10 Hardware: Intel CPU without nVidia Card and thus no CUDA availability

Steps to reproduce the behavior:

  1. pip uninstall all previous versions of dgl and torch
  2. Issue the following command: pip install dgl -f https://data.dgl.ai/wheels/repo.html
  3. Issue the following command: pip install dglgo -f https://data.dgl.ai/wheels-test/repo.html
  4. Start a python environment: python
  5. Issue the command import dgl
C:\Users\sarwj>python
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dgl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\__init__.py", line 14, in <module>
    from .backend import backend_name, load_backend  # usort: skip
  File "C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\backend\__init__.py", line 122, in <module>
    load_backend(get_preferred_backend())
  File "C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\backend\__init__.py", line 51, in load_backend
    from .._ffi.base import load_tensor_adapter  # imports DGL C library
  File "C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\_ffi\base.py", line 50, in <module>
    _LIB, _LIB_NAME, _DIR_NAME = _load_lib()
  File "C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\_ffi\base.py", line 39, in _load_lib
    lib = ctypes.CDLL(lib_path[0])
  File "C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\sarwj\AppData\Local\Programs\Python\Python310\lib\site-packages\dgl\dgl.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Expected behavior

  1. The correct NON-CUDA version of DGL is installed
  2. DGL is imported into python successfully with no errors and can be used.

Environment

  • DGL Version (e.g., 1.0): 2.0.0+cu121
  • Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3): PyTorch 2.1.2
  • OS (e.g., Linux): Windows 11
  • How you installed DGL (conda, pip, source): pip
  • Build command you used (if compiling from source):
  • Python version: 3.10
  • CUDA/cuDNN version (if applicable): None
  • GPU models and configuration (e.g. V100): N/A
  • Any other relevant information:

Additional context

wassimj avatar Jan 21 '24 10:01 wassimj

Seems you install dgl CUDA version in a machine without CUDA, please install the CPU version.

peizhou001 avatar Jan 25 '24 02:01 peizhou001

The issue is that the installation instructions are faulty and even when one selects NONE for CUDA, the command it gives installs a CUDA version. What is the pip install command to install a non-cuda version? Thank you.

wassimj avatar Jan 25 '24 05:01 wassimj

The issue seems to be related to the following: Wheel with no CUDA: dgl-2.0.0-cp310-cp310-win_amd64.whl Wheel with CUDA: dgl-2.0.0+cu121-cp310-cp310-win_amd64.whl One can see that the CUDA wheel name is lexicographically smaller than the no CUDA one due to + < -. However, I am not sure if that is exactly how it works. I am currently looking into it.

mfbalin avatar Feb 01 '24 18:02 mfbalin

The main problem seems to be the fact that the cuda wheels were uploaded to https://data.dgl.ai/wheels/repo.html, they probably should have been uploaded only to https://data.dgl.ai/wheels/cu121/repo.html instead.

mfbalin avatar Feb 01 '24 18:02 mfbalin

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Mar 03 '24 01:03 github-actions[bot]

Any update on this being fixed?

shreyasvinaya avatar Mar 08 '24 13:03 shreyasvinaya

@Rhett-Ying @peizhou001 any insights here?

mfbalin avatar Mar 27 '24 22:03 mfbalin

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Apr 27 '24 01:04 github-actions[bot]

Will this issue be fixed please?

wassimj avatar Apr 27 '24 04:04 wassimj

Next DGL release will be ready in May, let's see if this issue is fixed.

Rhett-Ying avatar Apr 28 '24 01:04 Rhett-Ying

Is there a workaround for this?

RaaghavM avatar Jun 21 '24 20:06 RaaghavM

Any update on this? Or at least can this be acknowldged as a bug? Thanks

wassimj avatar Jul 24 '24 04:07 wassimj

Hi,

Since 2024.06.27, we have stopped providing packages for Windows and MacOS. The latest version of available package is 2.2.1. For newer versions, please install from source.

Rhett-Ying avatar Jul 25 '24 01:07 Rhett-Ying