I want to install the GPU version of lightgbm on Ubuntu, based on the following command:
pip install lightgbm --install-option=--gpu
During installation, an error is occurred saying "Please install CMake first". After installing CMake, I get the same error again. To be sure that CMake is installed, I run the following command and get the correct version of the installed CMake:
/opt/cmake/bin/cmake -version
What is the possible reason of this error?
I got exactly this error, on Ubuntu 16.04 with CUDA installed and cmake version 3.5.1. In my case, despite the "Please install CMake" error, the issue was:
I was able to install LightGBM for Python by doing the following:
# Install boost libraries.
sudo apt-get install libboost-all-dev
# Get LightGBM source.
git clone --recursive https://github.com/Microsoft/LightGBM.git
cd LightGBM/python-package/
# cmake specifying locations of OpenCL files.
sudo cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda-8.0/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda-8.0/include/ ..
# Compile.
sudo make
# Install for Python, using what we just compiled.
python setup.py install --precompile
After that I was able to run Python and import lightgbm
successfully.
"Please install CMake" can mask other errors. To see more detail about what is going wrong, in LightGBM/python-package/setup.py
, in the function silent_call
, change the line
subprocess.check_output(cmd, stderr=shut_up)
to
subprocess.check_output(cmd)
and run
python setup.py install --gpu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With