Xtra-Computing / thundersvm

ThunderSVM: A Fast SVM Library on GPUs and CPUs
Apache License 2.0
1.55k stars 215 forks source link

thundersvm install in ubuntu22.04tsl #274

Closed BJTUpupil closed 6 months ago

BJTUpupil commented 6 months ago

When I tried to construct the wheel, an error occurred during compilation. The error message is as follows:

(torch) ubuntu@xxxx-Super-Server:~/thundersvm$ mkdir build && cd build && cmake .. && make -j
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
Compile with CUDA
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/thundersvm/build
[  3%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o
[  7%] Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^ 
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
CMake Error at thundersvm_generated_kernelmatrix_kernel.cu.o.Release.cmake:280 (message):
  Error generating file
  /home/ubuntu/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_kernelmatrix_kernel.cu.o

make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/build.make:77: src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_kernelmatrix_kernel.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^ 
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
CMake Error at thundersvm_generated_smo_kernel.cu.o.Release.cmake:280 (message):
  Error generating file
  /home/ubuntu/thundersvm/build/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/./thundersvm_generated_smo_kernel.cu.o

make[2]: *** [src/thundersvm/CMakeFiles/thundersvm.dir/build.make:84: src/thundersvm/CMakeFiles/thundersvm.dir/kernel/thundersvm_generated_smo_kernel.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:101: src/thundersvm/CMakeFiles/thundersvm.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

my server information are as follows:

Python: 3.8.18
GPU Driver: NVIDIA-SMI 525.147.05   Driver Version: 525.147.05   CUDA Version: 12.0 
System: ubuntu 22.04

I tried to construct the wheel in google colab successfully, but I don’t know why I keep getting errors on the local server. Thank you very much for your answer. @zeyiwen or is there anyone else who can help me?

BJTUpupil commented 6 months ago

After a day of hard work, I finally solved this problem. I suspected that there might be a problem with my cuda, so I upgraded it to 12.2. The upgrade reference link is as follows: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local https://www.cherryservers.com/blog/install-cuda-ubuntu