Lightgbm: Error: No OpenCL Device Found

Created on 4 Jun 2017  路  6Comments  路  Source: microsoft/LightGBM

I tried to enable GPU support, but ran into an error.

Environment info

Operating System: Ubuntu 16.04
CPU: Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
C++/Python/R version: gcc 5.4.0
GPU: Nvidia Titan X

Error Message:

/home/deep/LightGBM/lightgbm: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by /home/deep/LightGBM/lightgbm)
/home/deep/LightGBM/lightgbm: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by /home/deep/LightGBM/lightgbm)
[LightGBM] [Info] Finished loading parameters
[LightGBM] [Info] Loading weights...
[LightGBM] [Info] Loading weights...
[LightGBM] [Info] Finished loading data in 0.092822 seconds
[LightGBM] [Info] Number of positive: 3716, number of negative: 3284
[LightGBM] [Info] This is the GPU trainer!!
[LightGBM] [Info] Total Bins 6143
[LightGBM] [Info] Number of data: 7000, number of used features: 28
Met Exceptions:
No OpenCL device found

Reproducible examples

examples/binary_classification

Steps to reproduce

  1. clone the latest master branch
  2. export LIBOPENCL=/usr/local/cuda/lib; export LIBOPENCL=/usr/local/cuda/lib64
  3. follow the build procedure for GPU support
  4. add device=gpu in examples/binary_classification/train.conf
  5. lightgbm config=train.conf

Most helpful comment

So what ended up solving it for me was:
mkdir -p /etc/OpenCL/vendors && \ echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

I got this from the gpu docker file. Solved my problem, hope it helps!

All 6 comments

does anyone know how to fix it? thanks!

from this:

/home/deep/LightGBM/lightgbm: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by /home/deep/LightGBM/lightgbm)

it seems there are some errors related to the OpenCL installation.

Some references:

https://stackoverflow.com/questions/137773/what-does-the-no-version-information-available-error-from-linux-dynamic-linker

https://github.com/mbevand/silentarmy/issues/72

I'm having the exact same problem. Did you manage to solve it?

So what ended up solving it for me was:
mkdir -p /etc/OpenCL/vendors && \ echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

I got this from the gpu docker file. Solved my problem, hope it helps!

I face the same question:LightGBMError: No OpenCL device found while using jupyter notebook, I do the following procedure in jupyter notebook terminals:

git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
mkdir build 
cd build
cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda-10.0/lib64/libOpenCL.so -DOpenCL_
INCLUDE_DIR=/usr/local/cuda-10.0/include/ ..
make -j$(nproc)
cd ..

cd python-packages/
python setup.py install --gpu --opencl-include-dir=/usr/local/cuda-10.0/include/

and every thing goes fine.
But after I import lightgbm in jupyter and use the

lgbres = lgb.LGBMRegressor(...)
lgbres.fit(train,y_train)

* It goes wrong.* Showing:
~/anaconda3/lib/python3.6/site-packages/lightgbm/basic.py in _safe_call(ret)
44 The return value from C API calls.
45 """
---> 46 if ret != 0:
47 raise LightGBMError(decode_string(_LIB.LGBM_GetLastError()))
48

LightGBMError: No OpenCL device found

Could someone help me ? Thanks

I got the same error. This is the solution I follow:
https://www.kaggle.com/kirankunapuli/ieee-fraud-lightgbm-with-gpu

Was this page helpful?
0 / 5 - 0 ratings