deftdawg-detect-gpu #2

Closed
deftdawg wants to merge 3 commits from deftdawg/bitsandbytes-rocm:deftdawg-detect-gpu into stale
2 changed files with 3 additions and 6 deletions

View File

@ -117,8 +117,8 @@ HIP_INCLUDE := -I $(ROOT_DIR)/csrc -I $(ROOT_DIR)/include
HIP_LIB := -L$(ROCM_DIR)/lib -L$(ROCM_DIR)/llvm/bin/../lib/clang/15.0.0/lib/linux -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/lib -L/usr/lib -lgcc_s -lgcc -lpthread -lm -lrt -lamdhip64 -lhipblas -lhipsparse -lclang_rt.builtins-x86_64 -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
hip: $(BUILD_DIR)
$(HIPCC) -std=c++14 -c -fPIC --amdgpu-target=gfx1030 $(HIP_INCLUDE) -o $(BUILD_DIR)/ops.o -D NO_CUBLASLT $(CSRC)/ops.cu
$(HIPCC) -std=c++14 -c -fPIC --amdgpu-target=gfx1030 $(HIP_INCLUDE) -o $(BUILD_DIR)/kernels.o -D NO_CUBLASLT $(CSRC)/kernels.cu
$(HIPCC) -std=c++14 -c -fPIC --amdgpu-target=`rocm_agent_enumerator -t GPU | sort -t 'x' -k 2n | tail -1` $(HIP_INCLUDE) -o $(BUILD_DIR)/ops.o -D NO_CUBLASLT $(CSRC)/ops.cu
$(HIPCC) -std=c++14 -c -fPIC --amdgpu-target=`rocm_agent_enumerator -t GPU | sort -t 'x' -k 2n | tail -1` $(HIP_INCLUDE) -o $(BUILD_DIR)/kernels.o -D NO_CUBLASLT $(CSRC)/kernels.cu
# $(HIPCC) -fPIC -static $(BUILD_DIR)/ops.o $(BUILD_DIR)/kernels.o -o $(BUILD_DIR)/link.so
$(GPP) -std=c++14 -D__HIP_PLATFORM_AMD__ -DBUILD_CUDA -shared -fPIC -I /opt/rocm/include $(HIP_INCLUDE) $(BUILD_DIR)/ops.o $(BUILD_DIR)/kernels.o $(FILES_CPP) $(HIP_LIB) -o ./bitsandbytes/libbitsandbytes_hip_nocublaslt.so

View File

@ -16,12 +16,9 @@ In `Makefile`:
# activate your VENV, if using this within a VENV
git clone https://git.ecker.tech/mrq/bitsandbytes-rocm
make hip
CUDA_VERSION=gfx1030 python setup.py install # assumes you're using a 6XXX series card
CUDA_VERSION=`rocm_agent_enumerator -t GPU | sort -t 'x' -k 2n | tail -1` python setup.py install # assumes rocm_agent_enumerator is available in your PATH
python3 -m bitsandbytes # to validate it works
```
**!**NOTE**!**: this assumes you have a AMD 6XXX series card. Adapt this to your proper GFX version if different.
---
# bitsandbytes