-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue installing software: "UserWarning: An issue occurred while importing 'torch-sparse'. Disabling its usage." #2
Comments
Hello, just pinging this issue to see if there are any updates? Cheers. |
Hi Henry, seems like your pyg installation has errors. can you try to import torch-sparse and see if it has errors independent of the KGWAS package? have you followed this https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html. notice that you will need to make sure your cuda version is correct. Also, looks like the error says that undefined symbol: __kmpc_fork_call. which is typically associated with OpenMP. This issue usually arises due to a mismatch between the installed libraries or missing OpenMP support. Ensure that OpenMP is installed on your system. |
Hello! Yes I can confirm I followed those linked instructions. This is what I get when I import torch-sparse. And yes, I double checked and openMP is enabled.
|
i see - can you try |
Hi, doing so returns
|
yes, looks like the pyg is not installed correctly. can you try re-install the pyg and related package? you can use the pip version, which i personally found it more bug-free. For example, you will need to make sure that the pytorch, OS, and cuda version match with what you have. For example, for pytorch 2.5, linux and cuda = 12.4, install pytorch first and then do: pip install torch_geometric |
Thank you. So I have pip list | grep torch
torch 2.5.1+cu124
torch_cluster 1.6.3+pt25cu124
torch-geometric 2.6.1
torch_scatter 2.1.2+pt25cu124
torch_sparse 0.6.18+pt25cu124
torch_spline_conv 1.2.2+pt25cu124
torchaudio 2.5.1+cu124
torchvision 0.20.1+cu124 And I followed your install steps as well as those from https://stackoverflow.com/questions/78286355/i-cant-find-pytorch-and-cudnn-version-for-cuda-12-4-which-versions-can-i-downl to force the versions I need but still returns (pytorch3) [hc@dell ]$ python -c "import torch; print(torch.__version__)"
2.5.1+cu124
(pytorch3) [hc@dell ]$ python -c "import torch; print(torch.version.cuda)"
12.4 But doing so still gives python -c "from torch_sparse import coalesce"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/torch_sparse/__init__.py", line 39, in <module>
from .storage import SparseStorage # noqa
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/torch_sparse/storage.py", line 7, in <module>
from torch_sparse.utils import Final, index_sort
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/torch_sparse/utils.py", line 5, in <module>
import torch_sparse.typing
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/torch_sparse/typing.py", line 2, in <module>
import pyg_lib # noqa
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/pyg_lib/__init__.py", line 34, in <module>
load_library('libpyg')
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/pyg_lib/__init__.py", line 31, in load_library
torch.ops.load_library(spec.origin)
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/torch/_ops.py", line 1350, in load_library
ctypes.CDLL(path)
File "/home/username/rds/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /rds/user/username/hpc-work/miniconda3/envs/pytorch2/lib/python3.10/site-packages/libpyg.so) |
I also ran nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jul_14_19:41:19_PDT_2021
Cuda compilation tools, release 11.4, V11.4.100
Build cuda_11.4.r11.4/compiler.30188945_0 And gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. as well as ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper. Let me know if any of this helps. I purged all packages and installed from scratch but to no avail, since TOOLKIT_CUDA_VERSION=cu114 pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$TOOLKIT_CUDA_VERSION
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/
Collecting torch
Downloading https://download.pytorch.org/whl/cu124/torch-2.5.1%2Bcu124-cp313-cp313-linux_x86_64.whl (908.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 908.2/908.2 MB 24.2 MB/s eta 0:00:00
Collecting torchvision
Downloading https://download.pytorch.org/whl/torchvision-0.2.0-py2.py3-none-any.whl (48 kB)
ERROR: Could not find a version that satisfies the requirement torchaudio (from versions: none)
ERROR: No matching distribution found for torchaudio |
yeah looks like your cuda version is 11.4, which is not compatible. can you upgrade your cuda version to the 11.8/12.1/12.4? |
Happy new year! Hmm I had a feeling this would be the case. It's a centrally managed cluster and I don't have permissions to do that unfortunately. Does that mean we're pretty much out of luck? |
@HenryCarr98 I had some luck installing KGWAS by installing dependencies through conda, see #1. Maybe that helps? |
Hello @abearab and thanks for your message. Could you just confirm how exactly you did that? |
you may start with this: conda env create -f https://raw.githubusercontent.com/abearab/KGWAS/refs/heads/master/environment.yml |
Ah great, looks good thank you. Does this fix help with the CUDA compatibility issues? Cheers |
Hopefully! The goal is conda will try to install compatible versions of these dependencies including |
Perfect, I'll give this a try. I'll let you know what the results are. Cheers and happy new year! |
I would like to install a package called KGWAS and run its demo code https://github.com/snap-stanford/KGWAS/blob/master/demo/kgwas_101.ipynb. I have installed it and all its dependencies , however, when I test it, it always returns me with an error message (attached below). Would you please help me with this issue?
Thank you very much!
The text was updated successfully, but these errors were encountered: