IBM / pytorch-large-model-support

Large Model Support in PyTorch
Apache License 2.0
132 stars 19 forks source link

ImportError: libcuda.so.1: cannot open shared object file: No such file or directory #12

Closed BOB99889 closed 1 year ago

BOB99889 commented 1 year ago

Hello , I get the folwwing error while trying to import torch library Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/bob/miniconda3/envs/wmlce_env/lib/python3.7/site-packages/torch/__init__.py", line 81, in <module> from torch._C import * ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

Steps to reproduce the error:

Conda List :


# packages in environment at /home/bob/miniconda3/envs/wmlce_env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
_openmp_mutex             5.1                       1_gnu
_pytorch_select           2.0             gpu_20258.g46cbccf    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
absl-py                   0.7.1                    py37_0
apex                      0.1.0_1.6.2     py37_614.g6ced8ce    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
atomicwrites              1.4.0                      py_0
attrs                     22.1.0           py37h06a4308_0
blas                      1.0                    openblas
brotli                    1.0.9                h5eee18b_7
brotli-bin                1.0.9                h5eee18b_7
brotlipy                  0.7.0           py37h27cfd23_1003
bzip2                     1.0.8                h7b6447c_0
c-ares                    1.19.1               h5eee18b_0
ca-certificates           2023.08.22           h06a4308_0
cairo                     1.16.0               hf32fb01_1
certifi                   2022.12.7        py37h06a4308_0
cffi                      1.14.6           py37h400218f_0
chardet                   3.0.4           py37h06a4308_1003
click                     7.0                      py37_0
cloudpickle               2.0.0              pyhd3eb1b0_0
coverage                  4.5.4            py37h7b6447c_0
cryptography              39.0.1           py37h9ce1e76_0
cudatoolkit               10.1.243           616.gc122b8b    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
cudatoolkit-dev           10.1.243           616.gc122b8b    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
cudnn                     7.6.3_10.1         590.g5627c5e    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
cxxfilt                   0.2.0           py_630.gafaef84    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
cycler                    0.11.0             pyhd3eb1b0_0
cytoolz                   0.12.0           py37h5eee18b_0
dask-core                 2021.10.0          pyhd3eb1b0_0
dbus                      1.13.18              hb2f20db_0
ddl                       1.5.0           py37_1306.g2d85fa8    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
decorator                 5.1.1              pyhd3eb1b0_0
expat                     2.5.0                h6a678d5_0
ffmpeg                    4.2.2                h20bf706_0
fontconfig                2.13.1               h6c09931_0
fonttools                 4.25.0             pyhd3eb1b0_0
freeglut                  3.0.0                hf484d3e_5
freetype                  2.11.0               h70c0345_0
fsspec                    2022.11.0        py37h06a4308_0
future                    0.17.1                   py37_0
giflib                    5.1.4                h14c3975_1
glib                      2.69.1               h4ff587b_1
gmp                       6.2.1                h295c915_3
gnutls                    3.6.15               he1e5248_0
graphite2                 1.3.14               h295c915_1
graphsurgeon              0.4.1           py37_634.g4ac44fb    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
grpcio                    1.16.1           py37hf8bcb03_1
gst-plugins-base          1.14.1               h6a678d5_1
gstreamer                 1.14.1               h5eee18b_1
harfbuzz                  1.8.8                hffaf4a1_0
hdf5                      1.10.2               hba1933b_1
hypothesis                3.59.1           py37h39e3cac_0
icu                       58.2                 he6710b0_3
idna                      2.8                      py37_0
imageio                   2.9.0              pyhd3eb1b0_0
importlib-metadata        4.11.3           py37h06a4308_0
importlib_metadata        4.11.3               hd3eb1b0_0
jasper                    2.0.14               hd8c5072_2
jpeg                      9b                   h024ee3a_2
kiwisolver                1.4.4            py37h6a678d5_0
lame                      3.100                h7b6447c_0
ld_impl_linux-64          2.38                 h1181459_1
leveldb                   1.20                 hf484d3e_1
libbrotlicommon           1.0.9                h5eee18b_7
libbrotlidec              1.0.9                h5eee18b_7
libbrotlienc              1.0.9                h5eee18b_7
libffi                    3.3                  he6710b0_2
libgcc-ng                 11.2.0               h1234567_1
libgfortran-ng            7.2.0                hdf63c60_3
libglu                    9.0.0                hf484d3e_1
libgomp                   11.2.0               h1234567_1
libidn2                   2.3.4                h5eee18b_0
libopenblas               0.3.13               h4367d64_0
libopencv                 3.4.7              748.g5e2fea8    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
libopus                   1.3.1                h7b6447c_0
libpng                    1.6.37               hbc83047_0
libprotobuf               3.8.0              596.gf044ff6    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
libstdcxx-ng              11.2.0               h1234567_1
libtasn1                  4.19.0               h5eee18b_0
libtiff                   4.1.0                h2733197_1
libunistring              0.9.10               h27cfd23_0
libuuid                   1.41.5               h5eee18b_0
libvpx                    1.7.0                h439df22_0
libwebp                   1.0.1                h8e7db2f_0
libxcb                    1.15                 h7f8727e_0
libxml2                   2.9.12               h03d6c58_0
llvmlite                  0.29.0           py37hd408876_0
lmdb                      0.9.22               hf484d3e_1
locket                    1.0.0            py37h06a4308_0
lz4-c                     1.9.4                h6a678d5_0
markdown                  3.1.1                    py37_0
matplotlib                3.4.3            py37h06a4308_0
matplotlib-base           3.4.3            py37hbbc1b5f_0
mock                      2.0.0                    py37_0
more-itertools            8.12.0             pyhd3eb1b0_0
munkres                   1.1.4                      py_0
nccl                      2.4.8              586.gdba67b7    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
ncurses                   6.4                  h6a678d5_0
nettle                    3.7.3                hbbd107a_1
networkx                  2.2                      py37_1
ninja                     1.9.0            py37hfd86e86_0
numactl                   2.0.12             591.g5f5b313    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
numba                     0.45.1           py37h962f231_0
numpy                     1.16.6           py37h0a8e133_3
numpy-base                1.16.6           py37h41b4c56_3
olefile                   0.46                     py37_0
onnx                      1.5.0           py37_632.g66eb6ad    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
opencv                    3.4.7           py37_748.g5e2fea8    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
openh264                  2.1.1                h4ff587b_0
openmpi                   3.1.3              589.g0a9ea85    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
openssl                   1.1.1w               h7f8727e_0
packaging                 22.0             py37h06a4308_0
partd                     1.2.0              pyhd3eb1b0_1
pbr                       5.6.0              pyhd3eb1b0_0
pciutils                  3.6.2              589.g384a96e    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
pcre                      8.45                 h295c915_0
pillow                    7.1.2            py37hb39fc2d_0
pip                       22.3.1           py37h06a4308_0
pixman                    0.40.0               h7f8727e_1
pluggy                    1.0.0            py37h06a4308_1
powerai-license           1.6.2              734.g398a206    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
powerai-release           1.6.2              590.g8b407ea    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
powerai-tools             1.6.2              584.ga57254d    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
protobuf                  3.8.0           py37_606.ge232d90    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
psutil                    5.5.0            py37h7b6447c_0
py                        1.11.0             pyhd3eb1b0_0
py-opencv                 3.4.7           py37_748.g5e2fea8    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
pycparser                 2.21               pyhd3eb1b0_0
pyopenssl                 23.0.0           py37h06a4308_0
pyparsing                 3.0.9            py37h06a4308_0
pyqt                      5.9.2            py37h05f1152_2
pysocks                   1.7.1                    py37_1
pytest                    4.4.2                    py37_0
python                    3.7.13               h12debd9_0
python-dateutil           2.8.2              pyhd3eb1b0_0
python-lmdb               0.94             py37h14c3975_0
pytorch                   1.2.0            20258.g46cbccf    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
pytorch-base              1.2.0           gpu_py37_20258.g46cbccf    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
pywavelets                1.1.1            py37h7b6447c_2
pyyaml                    5.4.1            py37h27cfd23_1
qt                        5.9.7                h5867ecd_1
readline                  8.2                  h5eee18b_0
requests                  2.22.0                   py37_1
scikit-image              0.15.0           py37he6710b0_0
scipy                     1.3.2            py37he2b7bc3_0
setuptools                65.6.3           py37h06a4308_0
sip                       4.19.8           py37hf484d3e_0
six                       1.12.0                   py37_0
snappy                    1.1.9                h295c915_0
sqlite                    3.38.2               hc218d9a_0
tabulate                  0.8.2                    py37_0
tbb                       2021.8.0             hdb19cb5_0
tensorboard               1.15.0          py37_ab7f72a_3676.g60d75b8    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
tensorrt                  6.0.1.5         py37_634.g4ac44fb    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
tk                        8.6.11               h1ccaba5_0
toolz                     0.12.0           py37h06a4308_0
torchtext                 0.4.0           py37_596.g730653b    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
torchvision-base          0.4.0           gpu_py37_613.g2f2b557    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
tornado                   6.2              py37h5eee18b_0
tqdm                      4.32.1                     py_0
typing                    3.6.4                    py37_0
typing_extensions         3.7.2           py37_1596.g5249206    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
uff                       0.6.5           py37_634.g4ac44fb    https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda
urllib3                   1.25.11                    py_0
werkzeug                  0.15.4                     py_0
wheel                     0.38.4           py37h06a4308_0
x264                      1!157.20191217       h7b6447c_0
xz                        5.4.2                h5eee18b_0
yaml                      0.2.5                h7b6447c_0
zipp                      3.11.0           py37h06a4308_0
zlib                      1.2.11               h7f8727e_4
zstd                      1.4.9                haebb681_0

and when i checked the variable with echo $LD_LIBRARY_PATH , i get this result

/usr/lib/wsl/drivers/nv_dispui.inf_amd64_bbcc419573b233aa/libcuda.so.1:/usr/lib/wsl/drivers/nv_dispui.inf_amd64_bbcc419573b233aa/:/home/bob/miniconda3/envs/wmlce_env/extras/CUPTI/lib64::/home/bob/miniconda3/envs/wmlce_env/cuda/lib::/usr/lib/wsl/drivers/nv_dispui.inf_amd64_bbcc419573b233aa/

But this didn't work , I tried also to install the pytorch seperatly with conda install pytorch=1.3.1 -c https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda

I still get the same error, is there any other option i can explore

BOB99889 commented 1 year ago

i resolved this problem by creating a symbol link to the file libcuda.so.1 with the command. ln -s /usr/lib/wsl/drivers/nv_dispui.inf_amd64_bbcc419573b233aa/libcuda.so.1