Skip to content

Instantly share code, notes, and snippets.

@kayush2O6
Last active May 10, 2021 06:21
Show Gist options
  • Save kayush2O6/c9b81a25062ddb1616e6f6d8ff767093 to your computer and use it in GitHub Desktop.
Save kayush2O6/c9b81a25062ddb1616e6f6d8ff767093 to your computer and use it in GitHub Desktop.
rapids'cuml on google colab
BEFORE INSTALLING THE CUML, PLEASE MAKE SURE YOU HAVE FOLLOWED THE ABOVE STEPS FOR CUDF. CUDF SHOULD BE WORKING...
Step 1: Install the cuml and its depandencies.
!apt install libopenblas-base libomp-dev
!pip install cuml-cuda100
# import cuml at this point, will give libcuml.so not found error. #
NOTE: Step2 is optional and is just for information, you can fast forward to Step3 directly to work quickely.
Step 2: find the location of libcuml.so
!find / -name libcuml.so*
# You should get something like this: /usr/local/lib/python3.6/dist-packages/libcuml.so #
**IMPORTANT**: At this point, if you are using terminal, then you update the $LD_LIBRARY_PATH environment variable
with the location of libcuml.so, and it will work.
checkout out my git comment regarding this: https://github.com/rapidsai/cuml/issues/404#issuecomment-487054041
But, jupyter notebook load this $LDLIBRARY_PATH at the start time only, so even if you update the LD_LIBRARY_PATH in notebook
cell, it will not be loaded by notebook.
Step 3: In order to solve this issue in colab, run the below command.
!cp /usr/local/lib/python3.6/dist-packages/libcuml.so /usr/lib64-nvidia/
Now, you can use import cuml and run you code.
@tonewhoo
Copy link

tonewhoo commented May 9, 2021

on running " !pip install cuml-cuda100" command in colab gives below error:

Collecting cuml-cuda100 Using cached https://files.pythonhosted.org/packages/87/9e/4329e8a39672ed011b372981ba337ca0a0d923c7cbd9e96725f757094167/cuml-cuda100-0.6.1.post1.tar.gz Building wheels for collected packages: cuml-cuda100 Building wheel for cuml-cuda100 (setup.py) ... error ERROR: Failed building wheel for cuml-cuda100 Running setup.py clean for cuml-cuda100 Failed to build cuml-cuda100 Installing collected packages: cuml-cuda100 Running setup.py install for cuml-cuda100 ... error ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2eewpayy/cuml-cuda100/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2eewpayy/cuml-cuda100/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d50wb7pa/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Not sure what am i missing here.

I got the same error

@kayush2O6
Copy link
Author

Hi @tonewhoo @TaherLkdw, I am afraid these instructions are obsolete now.

Please refer these new instructions mentioned in official page of rapids.ai colab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment