microsoft / LightGBM

A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
https://lightgbm.readthedocs.io/en/latest/
MIT License
16.55k stars 3.82k forks source link

OpenCL with Cuda under Windows #501

Closed spedygiorgio closed 7 years ago

spedygiorgio commented 7 years ago

Hi All, I am following your tutorial to build the R package with MGCVWIN under windows. I have a NVIDA GPU graphics card so I downloaded the Cuda toolkit. When building the development version of the package the following error raises to me:

* installing *source* package 'lightgbm' ...
** libs
c:/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG -I../..//include -I"C:/boost/boost-build/include" -I"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/CL" -I../compute/include -DUSE_SOCKET -DUSE_GPU=1    -I"d:/Compiler/gcc-4.9.3/local330/include"  -fopenmp -pthread -std=c++11   -O2 -Wall  -mtune=core2 -c lightgbm-all.cpp -o lightgbm-all.o
In file included from C:/boost/boost-build/include/boost/compute/config.hpp:16:0,
                 from C:/boost/boost-build/include/boost/compute/buffer.hpp:14,
                 from C:/boost/boost-build/include/boost/compute/core.hpp:18,
                 from ../../src/treelearner/gpu_tree_learner.h:27,
                 from ../../src/treelearner/parallel_tree_learner.h:8,
                 from ../../src/treelearner/data_parallel_tree_learner.cpp:1,
                 from lightgbm-all.cpp:31:
C:/boost/boost-build/include/boost/compute/cl.hpp:17:19: fatal error: CL/cl.h: No such file or directory
 #include <CL/cl.h>
                   ^
compilation terminated.
make: *** [lightgbm-all.o] Error 1
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-34~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-34~1.0/share/make/winshlib.mk" CXX='$(CXX11) $(CXX11STD)' CXXFLAGS='$(CXX11FLAGS)' CXXPICFLAGS='$(CXX11PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX11LDFLAGS)' SHLIB_LD='$(SHLIB_CXX11LD)' SHLIB="lightgbm.dll" WIN=64 TCLBIN=64 ' had status 2
ERROR: compilation failed for package 'lightgbm'
* removing 'D:/RPackages/lightgbm'
* restoring previous 'D:/RPackages/lightgbm'

I found the indicated files for OpenCL in the following dirs:

BOOST_INCLUDE_DIR = "C:/boost/boost-build/include" BOOST_LIBRARY = "C:/boost/boost-build/lib" OpenCL_INCLUDE_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/CL" OpenCL_LIBRARY = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/win32"

Any help will be appreciated

Laurae2 commented 7 years ago

Use this for OpenCL_INCLUDE_DIR:

OpenCL_INCLUDE_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include"

Because LightGBM is looking for the folder/file CL/cl.h, in your case it was looking for C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/CL/CL/cl.h (causing an error as it does not exist).

spedygiorgio commented 7 years ago

Well, it goes on but it throw the following error:

I have an NVIDIA Quadro M3000M cuda above, I used R 3.4 x 64 path below: C:\Program Files\Microsoft MPI\Bin\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\SASHome\x86\SASFoundation\9.4\ets\sasexe;C:\Program Files\SASHome\Secure\ccme4;C:\Program Files\SASHome\x86\Secure\ccme4;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\Anaconda3;C:\Program Files\Anaconda3\Scripts;C:\Program Files\Anaconda3\Library\bin;C:\Program Files\Git\cmd;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Plantronics\Spokes3G\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files (x86)\Xoreax\IncrediBuild;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Users\UGA04625\AppData\Local\rstudio\spark\Cache\spark-2.0.1-bin-hadoop2.7\bin;C:\Rtools\bin;c:\Rtools\mingw_64\bin;C:\Program Files\qpdf-6.0.0\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\CMake\bin;C:\boost\boost-build\bin;C:\boost\boost-build\include\boost

spedygiorgio commented 7 years ago

fixed this steps thanks. By the way I suggest to add some reverences to NVIDIA cuda in the docs.

G

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.