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

[BUG] AMD GPU compilation from source #1468

Open
krenax opened this issue Jan 4, 2025 · 6 comments
Open

[BUG] AMD GPU compilation from source #1468

krenax opened this issue Jan 4, 2025 · 6 comments

Comments

@krenax
Copy link

krenax commented Jan 4, 2025

System Info

Linux Mint 21.3 x86_64
Python 3.10.12
AMD Ryzen 5 1600
AMD Radeon RX 7900XTX

Reproduction

Run the commands in the section: Compiling from Source (AMD GPU).
Using the AMD 7900XTX, run cmake -DBNB_ROCM_ARCH="gfx942" -DCOMPUTE_BACKEND=hip -S ..

The following error message will be returned:

cmake -DBNB_ROCM_ARCH="gfx942" -DCOMPUTE_BACKEND=hip -S .  # Use -DBNB_ROCM_ARCH="gfx90a;gfx942" to target specific gpu arch 
-- Configuring bitsandbytes (Backend: hip)
-- NO_CUBLASLT := OFF
-- The HIP compiler identification is unknown
CMake Error at /usr/local/share/cmake-3.31/Modules/CMakeDetermineHIPCompiler.cmake:174 (message):
  Failed to find ROCm root directory.
Call Stack (most recent call first):
  CMakeLists.txt:193 (enable_language)

Expected behavior

The compilation should finish without an error message.

@derfasthirnlosenick
Copy link

You should run it with gfx1100, as that's your architecture.

I get the same error though on my 6800XT with gfx1030.

@krenax
Copy link
Author

krenax commented Jan 5, 2025

Using gfx1100 gives the same error.

@nikhil-tensorwave
Copy link

Try adding ROCM_HOME="/opt/rocm" as an environment variable, that has solved a similar issue for me in the past.

@derfasthirnlosenick
Copy link

Try adding ROCM_HOME="/opt/rocm" as an environment variable, that has solved a similar issue for me in the past.

No Bueno, didn't work :(

@jnolck
Copy link

jnolck commented Jan 12, 2025

Try adding ROCM_HOME="/opt/rocm" as an environment variable, that has solved a similar issue for me in the past.

No Bueno, didn't work :(

I had to set this on my bashrc for it to compile.

'''
export HIP_PATH=/usr
export ROCM_PATH=/usr
export HIP_PLATFORM=amd
export HIP_RUNTIME=rocclr
export HIP_COMPILER=clang
export HIP_CLANG_PATH=/usr/lib64/llvm18/bin
export DEVICE_LIB_PATH=/usr/lib64/rocm/llvm/lib/clang/18/amdgcn/bitcode/
export HIP_DEVICE_LIB_PATH=/usr/lib64/rocm/llvm/lib/clang/18/amdgcn/bitcode/
export HSA_PATH=/usr/hsa
export LLVM_PATH=/usr
'''
I don't think it needs all of them. I got them from hipconfig. rerun your command afterwards. Manually inputed the device lib paths. Got the info from looking it where the rpm's put that into. You'll have to modify those to how mint does things.

I ran into the same issue with.

@derfasthirnlosenick
Copy link

Still not working, but hipcc seems to be fubar as well, so I might just reinstall Rocm and see if that fixes things.

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

No branches or pull requests

4 participants