colab中安装lightgbm的GPU版本

完整代码如下:

%%time
# CPU times: user 928 ms, sys: 328 ms, total: 1.26 s
# Wall time: 43.7 s
!rm -r /kaggle/working/lightgbm_kaggle 
!rm -r /kaggle/working/LightGBM
!rm -r /opt/conda/lib/python3.6/site-packages/lightgbm
# !git clone --recursive https://github.com/Microsoft/LightGBM
!git clone https://github.com/appleyuchi/lightgbm_colab
!mv lightgbm_colab  LightGBM

!apt-get install -y -qq libboost-all-dev
# !cd LightGBM;rm -r build;mkdir build;cd build;echo"here1";cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ ..;echo"here2";make -j$(nproc)
!cd LightGBM/python-package/;python setup.py install --precompile
!mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

!pip install -q 'pandas==0.25' --force-reinstall

 

你可能感兴趣的:(Colaboratory)