-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LightGBMError: GPU Tree Learner was not enabled in this build. Even when LightGBM was compiled successfully with CMake option -DUSE_GPU=1 #5928
Comments
Thanks for using LightGBM. First, please note that I've reformatted the text in your question to make it clearer. If you're new to GitHub, please read https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax to learn how to format text in GitHub-flavored markdown.
It appears you're trying to use the LightGBM Python package, The commands you've provided only compiled the C++ shared library, Either like this: git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
rm -rf ./build
mkdir build
cd ./build
cmake -DUSE_GPU=1 ..
make -j4
cd ..
sh ./build-python.sh install --precompile Or like this (to do compilation + installation of the Python package in one step): sh ./build-python.sh install --gpu This is documented at https://github.com/microsoft/LightGBM/tree/master/python-package#install-from-github. |
Hi James Thanks for your help. Google seems to prefer directing all my queries to https://lightgbm.readthedocs.io/en/stable/Installation-Guide.html#id17... And the information seems a little contradictory at times. But if the GPU version is available in binary for Windows without having to recompile it first, I'll give that a try first... Thx, |
We'd welcome pull requests fixing whatever information you find to be "contradictory". Or, if you can be specific about what is confusing, misleading, or inaccurate, I'd be happy to make the relevant changes in the docs.
It is. That support was added a few years ago, in #3144. I didn't mention that option earlier because in your initial post, you mentioned cloning LightGBM from GitHub... so I assumed you wanted to build from the latest development version. If using the most recent release of I'm also surprised to learn that a Windows-only solution would work for you, since your report above contains log lines like the following with Unix-style paths:
And since as far as I know, Google Colab only supports Linux. |
Thx James, if GPU support readily available in binary form, I will try to install it again on my Win11 laptop (it's a pain finding stable Linux/laptop combination...). I did attempt to compile LightGBM w/ VisualStudio with instruction from https://lightgbm.readthedocs.io/en/stable/Installation-Guide.html#id17 a month ago, but I wasn't able to get it to work... So I turned to Colab/Sage/Lambda, and none of them is a straight forward python installation... I will try solution from #3144, and I hope it works. I will update you on the progress. Thx again! |
If you can provide a reproducible example, including all commands you ran and the errors you encountered, we'd be happy to help. Every commit to The next release (#5153) will also include integrated-OpenCL wheels for Linux, where you can just |
I have also encountered this issue. I am a novice and need to use the LGBM package when testing my. ipynb code. However, the Python environment I am using can only be imported correctly through pip installation. After pip installation, the prompt 'GPU Tree Learner was not enabled in this build.' |
What does "not able to reference packages downloaded from GitHub in my environment" mean specifically? If, as I suspect, you just mean that you only have access to an IPython notebook and not a shell, you should actually be able to run arbitrary shell commands using
Or if you mean that you don't have
Note that I intentionally pinned to v3.3.5 in that example, as Also note that the If neither of these work for you, please describe precisely that you mean by "not able to reference packages downloaded from Github". |
This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM! |
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. |
Description
In Google Colab, I did:
Compilation was completed successfully to 100%.
When I ran
I received the following error message:
What happened? Didn't I just compile LightGBM with
-DUSE_GPU=1
successfully? Why doesn't it pick up the GPU option?Reproducible example
Environment info
Google Colab:
LightGBM version or commit hash: 3.3.5
Command(s) you used to install LightGBM
The text was updated successfully, but these errors were encountered: