Skip to content

[Bug] won't build with HipBLAS. sd.cpp tries to use CUDA regardless. #1238

@Username1020382920382

Description

@Username1020382920382

Git commit

newest as of Jan 30th

Operating System & Version

CachyOS (kernel 6.18.7-2)

GGML backends

HIP

Command-line arguments used

mkdir build && cd build if command -v rocminfo; then export GFX_NAME=$(rocminfo | awk '/ *Name: +gfx[1-9]/ {print $2; exit}'); else echo "rocminfo missing!"; fi if [ -z "${GFX_NAME}" ]; then echo "Error: Couldn't detect GPU!"; else echo "Building for GPU: ${GFX_NAME}"; fi cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=$GFX_NAME -DAMDGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON cmake --build . --config Release

Steps to reproduce

followed the building guide from: https://github.com/leejet/stable-diffusion.cpp/blob/master/docs/build.md for HipBLAS on RX 6600. SD.CPP tries to compile with CUDA regardless of HIP being enabled.

here is the output of 'cmake -LAH | grep -i CUDA'

// ggml: use CUDA
GGML_CUDA:BOOL=OFF
// ggml: cuda link binary compression mode; requires cuda 12.8+
GGML_CUDA_COMPRESSION_MODE:STRING=size
// ggml: compile ggml FlashAttention CUDA kernels
GGML_CUDA_FA:BOOL=OFF
GGML_CUDA_FA_ALL_QUANTS:BOOL=OFF
GGML_CUDA_FORCE_CUBLAS:BOOL=OFF
GGML_CUDA_FORCE_MMQ:BOOL=OFF
// ggml: use CUDA graphs (llama.cpp only)
GGML_CUDA_GRAPHS:BOOL=OFF
GGML_CUDA_NO_PEER_COPY:BOOL=OFF
// ggml: do not try to use CUDA VMM
GGML_CUDA_NO_VMM:BOOL=OFF
GGML_CUDA_PEER_MAX_BATCH_SIZE:STRING=128
// sd: cuda backend
SD_CUDA:BOOL=OFF
// sd: x1.5 faster softmax, indeterministic (sometimes, same seed don't generate same image), cuda only

What you expected to happen

finished compile and usable rocm.

What actually happened

clang++: error: unsupported CUDA gpu architecture: gfx1032

Logs / error messages / stack trace

[ 1%] Built target zip
[ 7%] Built target ggml-base
[ 8%] Building HIP object ggml/src/ggml-hip/CMakeFiles/ggml-hip.dir//ggml-cuda/acc.cu.o
clang++: error: unsupported CUDA gpu architecture: gfx1032
clang++: error: cannot find CUDA installation; provide its path via '--cuda-path', or pass '-nocudainc' to build without CUDA includes
make[2]: *** [ggml/src/ggml-hip/CMakeFiles/ggml-hip.dir/build.make:78: ggml/src/ggml-hip/CMakeFiles/ggml-hip.dir/
/ggml-cuda/acc.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:401: ggml/src/ggml-hip/CMakeFiles/ggml-hip.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Additional context / environment details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions