1

I wanted to install cuml package using this !pip install cuml. Although, this worked previously. However, it's not working right now and gives me the following outputs:


Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting cuml
  Downloading cuml-0.6.1.post1.tar.gz (1.1 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: cuml
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for cuml (setup.py) ... error
  ERROR: Failed building wheel for cuml
  Running setup.py clean for cuml
Failed to build cuml
Installing collected packages: cuml
  error: subprocess-exited-with-error
  
  × Running setup.py install for cuml did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Running setup.py install for cuml ... error
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cuml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I used these commands to install the package but when I import the package I get the following error:

Command

!pip install cupy-cuda11x
!pip install cuml-cu11 --extra-index-url=https://pypi.ngc.nvidia.com

Outputs

/usr/local/lib/python3.8/site-packages/cudf/utils/gpu_utils.py:148: UserWarning: No NVIDIA GPU detected
  warnings.warn("No NVIDIA GPU detected")
---------------------------------------------------------------------------
CUDARuntimeError                          Traceback (most recent call last)
<ipython-input-1-95aa20f405cb> in <module>
     11 from sklearn import preprocessing, metrics
     12 from sklearn.model_selection import train_test_split, GridSearchCV
---> 13 from cuml.svm import SVR
     14 
     15 #from hummingbird.ml import convert,load

10 frames
kernel_shap.pyx in init cuml.explainer.kernel_shap()

elastic_net.pyx in init cuml.linear_model.elastic_net()

qn.pyx in init cuml.solvers.qn()

hinge_loss.pyx in init cuml.metrics.hinge_loss()

cuda.pyx in cuml.common.cuda.has_cuda_gpu()

/usr/local/lib/python3.8/site-packages/rmm/_cuda/gpu.py in getDeviceCount()
     99     status, count = cudart.cudaGetDeviceCount()
    100     if status != cudart.cudaError_t.cudaSuccess:
--> 101         raise CUDARuntimeError(status)
    102     return count
    103 

CUDARuntimeError: cudaErrorNoDevice: no CUDA-capable device is detected

I get these results because I think I'm not activating the GPU on the Colab.

3 Answers 3

1

To pip install RAPIDS cuML on Colab, ensure you're using a GPU runtime and then use pip install command noted here. You're missing the --extra-index-url option.

You will not be able to pip install cuML on Kaggle, as the pip packages require Python 3.8 or 3.9 but Kaggle is tied to Python 3.7 (at the time of writing).

0

Recent (May'23) Kaggle images come with cuml pre-installed.

python --version
pip show cuml
Python 3.10.10
Name: cuml
Version: 23.4.1
Summary: cuML - RAPIDS ML Algorithms
Home-page: 
Author: NVIDIA Corporation
Author-email: 
License: Apache 2.0
Location: /opt/conda/lib/python3.10/site-packages
Requires: cudf, cupy-cuda11x, dask, dask-cuda, dask-cudf, distributed, joblib, numba, raft-dask, scipy, seaborn, treelite, treelite_runtime
Required-by: 
1
  • Unfortunately, as of May 2024 cuml install on Kaggle is broken Simply importing cuml leads to: ImportError: cannot import name 'is_datetime64tz_dtype' from 'pandas.core.tools.datetimes' (/opt/conda/lib/python3.10/site-packages/pandas/core/tools/datetimes.py) I already submitted a github issue: github.com/Kaggle/docker-python/issues/1392 Commented May 13 at 20:35
0

The following code worked for me on Google Colab.

pip install --extra-index-url=https://pypi.nvidia.com cuml-cu12==24.4.* 

Check https://rapids.ai/ for other versions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.