ROCm / bitsandbytes

8-bit CUDA functions for PyTorch
MIT License
32 stars 3 forks source link

cmake -DCOMPUTE_BACKEND=hip -S . #34

Open shriharshan opened 1 month ago

shriharshan commented 1 month ago

System Info

Ryzen 5 5500u with integrated GPU

Reproduction

cmake -DCOMPUTE_BACKEND=hip -S `

When i try to run this command I get an Error like this

`` -- Configuring bitsandbytes (Backend: hip) -- NO_CUBLASLT := OFF -- The HIP compiler identification is unknown -- Detecting HIP compiler ABI info -- Detecting HIP compiler ABI info - failed -- Check for working HIP compiler: /opt/rocm-6.1.1/llvm/bin/clang++ -- Check for working HIP compiler: /opt/rocm-6.1.1/llvm/bin/clang++ - broken CMake Error at /usr/share/cmake-3.29/Modules/CMakeTestHIPCompiler.cmake:73 (message): The HIP compiler

"/opt/rocm-6.1.1/llvm/bin/clang++"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: '/home/harshan/bitsandbytes/CMakeFiles/CMakeScratch/TryCompile-OLJB4u'

Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_1424d/fast
/usr/bin/gmake  -f CMakeFiles/cmTC_1424d.dir/build.make CMakeFiles/cmTC_1424d.dir/build
gmake[1]: Entering directory '/home/harshan/bitsandbytes/CMakeFiles/CMakeScratch/TryCompile-OLJB4u'
Building HIP object CMakeFiles/cmTC_1424d.dir/testHIPCompiler.hip.o
/opt/rocm-6.1.1/llvm/bin/clang++    --offload-arch=gfx90c -o CMakeFiles/cmTC_1424d.dir/testHIPCompiler.hip.o  -c /home/harshan/bitsandbytes/CMakeFiles/CMakeScratch/TryCompile-OLJB4u/testHIPCompiler.hip
In file included from <built-in>:1:
In file included from /opt/rocm-6.1.1/lib/llvm/lib/clang/17/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.1.1/lib/llvm/lib/clang/17/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
   27 | #include_next <cmath>
      |               ^~~~~~~
1 error generated when compiling for gfx90c.
gmake[1]: *** [CMakeFiles/cmTC_1424d.dir/build.make:78: CMakeFiles/cmTC_1424d.dir/testHIPCompiler.hip.o] Error 1
gmake[1]: Leaving directory '/home/harshan/bitsandbytes/CMakeFiles/CMakeScratch/TryCompile-OLJB4u'
gmake: *** [Makefile:127: cmTC_1424d/fast] Error 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:175 (enable_language) ``

Also I am New to this, So, If I missed something please let me know

jamesxu2 commented 5 days ago

Hi @shriharshan , the 'cmath' file not found has a troubleshooting page: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/how-to/native-install/install-faq.html#issue-4-c-libraries

Please try this suggestion and let me know if it helps.