rapidsai / cuml

cuML - RAPIDS Machine Learning Library
https://docs.rapids.ai/api/cuml/stable/
Apache License 2.0
4.23k stars 532 forks source link

[BUG] cuml installation #5121

Closed MarMarhoun closed 1 year ago

MarMarhoun commented 1 year ago

Describe the bug I'm trying to install the package in Kaggle notebook (GPU) using the following commands:

!pip install cupy-cuda11x
!pip install cupy-cuda11x -f https://pip.cupy.dev/aarch64

Please consider that I used these two instructions before and it worked.

!conda create -n rapids-22.08 -c rapidsai -c nvidia -c conda-forge  \
cudf=22.08 cuml=22.08 cugraph=22.08 cuspatial=22.08 cuxfilter=22.08 cusignal=22.08 cucim=22.08 python=3.8 cudatoolkit=11.5 \
jupyterlab dask-sql graphistry dash pycaret xarray-spatial --yes

Steps/Code to reproduce bug First, use the two commands and then import the package to see if installed successfully. If not then you can use the third command which includes all the necessary packages of RAPIDS that you will need. Which will produce the same

Expected behavior When I import the package using the first two instructions:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/cupy/__init__.py in <module>
     17 try:
---> 18     from cupy import _core  # NOQA
     19 except ImportError as exc:

/opt/conda/lib/python3.7/site-packages/cupy/_core/__init__.py in <module>
      2 
----> 3 from cupy._core import core  # NOQA
      4 from cupy._core import fusion  # NOQA

ImportError: libnvrtc.so.11.2: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
/tmp/ipykernel_23/2289778354.py in <module>
----> 1 import cuml

/opt/conda/lib/python3.7/site-packages/cuml/__init__.py in <module>
     15 #
     16 
---> 17 from cuml.common.base import Base
     18 from cuml.common.handle import Handle
     19 import cuml.common.cuda as cuda

/opt/conda/lib/python3.7/site-packages/cuml/common/__init__.py in <module>
     15 #
     16 
---> 17 from cuml.common.array import CumlArray
     18 from cuml.common.array_sparse import SparseCumlArray
     19 

/opt/conda/lib/python3.7/site-packages/cuml/common/array.py in <module>
     15 #
     16 
---> 17 import cupy as cp
     18 import numpy as np
     19 import operator

/opt/conda/lib/python3.7/site-packages/cupy/__init__.py in <module>
     25   {type(exc).__name__}: {exc}
     26 ================================================================
---> 27 ''') from exc
     28 
     29 

ImportError: 
================================================================
Failed to import CuPy.

If you installed CuPy via wheels (cupy-cudaXXX or cupy-rocm-X-X), make sure that the package matches with the version of CUDA or ROCm installed.

On Linux, you may need to set LD_LIBRARY_PATH environment variable depending on how you installed CUDA/ROCm.
On Windows, try setting CUDA_PATH environment variable.

Check the Installation Guide for details:
  https://docs.cupy.dev/en/latest/install.html

Original error:
  ImportError: libnvrtc.so.11.2: cannot open shared object file: No such file or directory
================================================================

Environment details (please complete the following information):

daxiongshu commented 1 year ago

Hello, may I ask if you want to install cupy or cuml on kaggle via pip? And which version do you want to install? The title says cuml but the first two instructions are about cupy.

daxiongshu commented 1 year ago

Kaggle kernel has cupy 11.4 installed by default:

import cupy
cupy.__version__
'11.4.0'
daxiongshu commented 1 year ago

Unfortunately, kaggle kernel is python 3.7 and you can't pip install cuml on kaggle:

!pip install cuml-cu11 --extra-index-url=https://pypi.ngc.nvidia.com
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
ERROR: Ignored the following versions that require a different python version: 0.0.1 Requires-Python >=3.8
beckernick commented 1 year ago

Closing this as answered. To use cuML on Kaggle at the moment, you'll need to use an older conda package.

Thanks @daxiongshu