Xtra-Computing / thundergbm

ThunderGBM: Fast GBDTs and Random Forests on GPUs
Apache License 2.0
689 stars 84 forks source link

"File Modification Detected" and errors in Visual Studio #63

Closed AlanSpencer2 closed 2 years ago

AlanSpencer2 commented 2 years ago

downloaded the branch with cuda 11 support, for win10 and followed the instructions. When building the thundergbm.sln file in Visual Studio, I get a message that says "File Modification Detected". When choosing "Reload All" or any of the other options, the building ends up with a bunch of errors and bugs. Please see the pictures below for more details.

These are the steps I took before getting to the building process: git clone -b support_cuda11 --single-branch https://github.com/zeyiwen/thundergbm.git cd thundergbm git submodule init cub && git submodule update cd thundergbm mkdir build cd build cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 16 2019" the last step is to open the file thundergbm.sln and click on "build solution" in the "Build" menu in Visual Studio.

Here is the message window.

File Modification Detected

Down below is the errors generated by the building process, in the files xutility, xmemory, atomic and LINK.

errors thundergbm

Any idea what might be causing this?

QinbinLi commented 2 years ago

Hi @AlanSpencer2 ,

I have installed CUDA 11.5 and visual studio 2019 16.11.8, and followed your instructions to build the project. However, I can successfully build the project without compiling errors. There is a message window that you showed, but it does not affect the compiling of the project. Did you install the necessary components to build C++ projects in Visual Studio (e.g., check "Desktop development with C++" in "Tools->Get Tools and Features" in Visual Studio)?

AlanSpencer2 commented 2 years ago

The whole package "Desktop developement with C++" is humongous. Can you please say which components that are required to build thundergbm? As you can see in the picture below, I have already installed all the default components.

c++ tools

QinbinLi commented 2 years ago

Hi @AlanSpencer2 ,

The default components should be enough. I also only installed these components. Did you install CUDA before visual studio? The CUDA toolkit should be installed after visual studio so that the visual studio integration can work. You may try reinstalling CUDA 11.5 and see whether it works.

AlanSpencer2 commented 2 years ago

Yes, I did install CUDA (11.2) after Visual Studio, not before. There is no problem with the CUDA installation, because I use other applications that need CUDA without any problem.

You said in your first response that the message should not affect the compiling of the project. But if you look at the error descriptions, you can see that most of them are syntax errors, like parenthesis is missing in the code. If the code misses parenthesis, then it must be fixed. Why would CUDA be the cause of missing parenthesis?

Besides the syntax errors, there is one error that says "no suitable constructor exists to convert from el::HitCounter ** to...", and another error says "cannot open file ...\thundergbm.lib"... What might be causing these errors?

You said that you can successfully build the project. What does a successful build look like? Where do you call the random forest function after building the code? Can you please take a screen shot of what a successful build looks like?

QinbinLi commented 2 years ago

The errors are from files xutility, xmemory, etc, which are not from the sources files of ThunderGBM. The error "cannot open file ...\thundergbm.lib" means that the compiling is not successful and the library file cannot be generated.

I think the main issue is the incompatibility between your installed versions of CUDA and Visual Studio (and maybe cmake). Here are some references (ref1, ref2). I suggest you upgrade your CUDA to 11.5, VS to 16.11.8, and cmake to 3.22.1. I can successfully build ThunderGBM with these latest versions.

The screen shot of a successful build is below. For the calling of random forest, please refer to #42 . image

AlanSpencer2 commented 2 years ago

I upgraded all the versions as you suggested, CUDA to version 11.5, VS to 16.11.8 and cmake to 3.22.1. I still get the error below (please see picture) when trying to import thundergbm in Python.

error message in python

The building did not generate any errors, however, the output is a little different than yours. My output says "4 succeeded, 0 failed, and 1 skipped". You have "5 succeeded, 0 failed, 0 skipped".

After building the project, I installed the python wheel by using the command "python setup.py install".

Did you try to install the python wheel? Can you import thundergbm library in python? If not, where/how do you use thundergbms functions?

QinbinLi commented 2 years ago

What is the python version you used? I had the same error if using python 3.9. However, I could successfully import it using python 3.7.8. There may be some issues for python 3.8+ when loading .dll modules. Here are some references ref1, ref2.