Skip to content
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

Segmentation fault when use compilation option -DUSE_TIMETAG=ON #6387

Open
Piao-WU opened this issue Mar 27, 2024 · 2 comments
Open

Segmentation fault when use compilation option -DUSE_TIMETAG=ON #6387

Piao-WU opened this issue Mar 27, 2024 · 2 comments
Labels

Comments

@Piao-WU
Copy link

Piao-WU commented Mar 27, 2024

When I compile LightGBM with -DUSE_TIMETAG=ON, it will show segmentation fault after my code runs.
I found this caused by

for (auto it = ordered.begin(); it != ordered.end(); ++it) {
Log::Info("%s costs:\t %f", it->first.c_str(), it->second * 1e-3);
}

@jameslamb
Copy link
Collaborator

Thanks for using LightGBM.

Can you please share:

  • what compiler?
  • what operating system?
  • what version of LightGBM (or commit hash)?
  • exact commands you used to try to build the project

@Piao-WU
Copy link
Author

Piao-WU commented Mar 28, 2024

Thanks for using LightGBM.

Can you please share:

  • what compiler?
  • what operating system?
  • what version of LightGBM (or commit hash)?
  • exact commands you used to try to build the project

Thanks for replying. Here's my version info

  • Compiler: gcc 8.3.1
  • OS: CentOS Linux 8
  • python: 3.10.9
  • LightGBM: 4.0.0 (commit 32a5dbe)
  • Commands build the project
git clone --recursive https://github.com/microsoft/LightGBM  
cd LightGBM  
mkdir build
cd build
cmake -DOpenCL_LIBRARY=/usr/local/cuda/targets/x86_64-linux/lib/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/targets/x86_64-linux/include -DBoost_LIBRARY=/opt/3rd/boost/lib -DBoost_INCLUDE_DIR=/opt/3rd/boost/include -DUSE_GPU=1 -DUSE_TIMETAG=ON .. && make -j
cp lib_lightgbm.so python-package/lightgbm/lib/

In addition, I used std::cout instead of the original code and I found this works for me:

 for (auto it = ordered.begin(); it != ordered.end(); ++it) { 
   // Log::Info("%s costs:\t %f", it->first.c_str(), it->second * 1e-3); 
   std::cout << it->first << " cost " << it->second / std::chrono::milliseconds(1) << std::endl;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants