broncotc / bitsandbytes-rocm

MIT License
37 stars 14 forks source link

hipErrorNoBinaryForGpu #3

Open StormyIceLeopard opened 1 year ago

StormyIceLeopard commented 1 year ago

I have an RX 6700 XT and I am on Manjaro OS I am attempting to get this fork working for Stable Diffusion Dreambooth extension for 8bit adam Some users said they used this fork to get it working But I do not think it works for me atm. I am looking for help.

make CUDA_VERSION=gfx1030 hip results in the following

which: no nvcc in (/home/theiceleopard/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl) /opt/rocm/bin/hipcc -std=c++14 -c -fPIC --amdgpu-target=gfx1030 -I /home/theiceleopard/temp/bitsandbytes-rocm/csrc -I /home/theiceleopard/temp/bitsandbytes-rocm/include -o /home/theiceleopard/temp/bitsandbytes-rocm/build/ops.o -D NO_CUBLASLT /home/theiceleopard/temp/bitsandbytes-rocm/csrc/ops.cu Warning: The --amdgpu-target option has been deprecated and will be removed in the future. Use --offload-arch instead. /opt/rocm/bin/hipcc -std=c++14 -c -fPIC --amdgpu-target=gfx1030 -I /home/theiceleopard/temp/bitsandbytes-rocm/csrc -I /home/theiceleopard/temp/bitsandbytes-rocm/include -o /home/theiceleopard/temp/bitsandbytes-rocm/build/kernels.o -D NO_CUBLASLT /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu Warning: The --amdgpu-target option has been deprecated and will be removed in the future. Use --offload-arch instead. /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu:2461:17: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] __global__ void kspmm_coo_very_sparse_naive(int *max_count, int *max_idx, int *offset_rowidx, int *rowidx, int *colidx, half *values, T *B, half *out, float * __restrict__ const dequant_stats, int nnz, int rowsA, int rowsB, int colsB) ^ /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu:2461:17: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu:2461:17: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu:2461:17: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu:2461:17: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] /home/theiceleopard/temp/bitsandbytes-rocm/csrc/kernels.cu:2461:17: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] 6 warnings generated when compiling for gfx1030. /usr/bin/hipcc -fPIC -static /home/theiceleopard/temp/bitsandbytes-rocm/build/ops.o /home/theiceleopard/temp/bitsandbytes-rocm/build/kernels.o -o /home/theiceleopard/temp/bitsandbytes-rocm/build/link.so /usr/bin/g++ -std=c++14 -D__HIP_PLATFORM_AMD__ -DBUILD_CUDA -shared -fPIC -I /opt/rocm/include -I /home/theiceleopard/temp/bitsandbytes-rocm/csrc -I /home/theiceleopard/temp/bitsandbytes-rocm/include /home/theiceleopard/temp/bitsandbytes-rocm/build/ops.o /home/theiceleopard/temp/bitsandbytes-rocm/build/kernels.o /home/theiceleopard/temp/bitsandbytes-rocm/csrc/common.cpp /home/theiceleopard/temp/bitsandbytes-rocm/csrc/cpu_ops.cpp /home/theiceleopard/temp/bitsandbytes-rocm/csrc/pythonInterface.c -L/opt/rocm-5.3.0/lib -L/opt/rocm-5.3.0/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 -o ./bitsandbytes/libbitsandbytes_hip_nocublaslt.so

sudo CUDA_VERSION=gfx1030 python setup.py install results in the following

`libs: ['libbitsandbytes_hip_nocublaslt.so'] running install /usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info writing bitsandbytes.egg-info/PKG-INFO writing dependency_links to bitsandbytes.egg-info/dependency_links.txt writing entry points to bitsandbytes.egg-info/entry_points.txt writing top-level names to bitsandbytes.egg-info/top_level.txt reading manifest file 'bitsandbytes.egg-info/SOURCES.txt' adding license file 'LICENSE' adding license file 'NOTICE.md' writing manifest file 'bitsandbytes.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying bitsandbytes/libbitsandbytes_hip_nocublaslt.so -> build/lib/bitsandbytes creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/bitsandbytes copying build/lib/bitsandbytes/init.py -> build/bdist.linux-x86_64/egg/bitsandbytes copying build/lib/bitsandbytes/libbitsandbytes_hip_nocublaslt.so -> build/bdist.linux-x86_64/egg/bitsandbytes copying build/lib/bitsandbytes/utils.py -> build/bdist.linux-x86_64/egg/bitsandbytes copying build/lib/bitsandbytes/functional.py -> build/bdist.linux-x86_64/egg/bitsandbytes creating build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/sgd.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/init.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/optimizer.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/adagrad.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/adamw.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/rmsprop.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/lars.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/lamb.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/optim/adam.py -> build/bdist.linux-x86_64/egg/bitsandbytes/optim copying build/lib/bitsandbytes/cextension.py -> build/bdist.linux-x86_64/egg/bitsandbytes creating build/bdist.linux-x86_64/egg/bitsandbytes/autograd copying build/lib/bitsandbytes/autograd/init.py -> build/bdist.linux-x86_64/egg/bitsandbytes/autograd copying build/lib/bitsandbytes/autograd/_functions.py -> build/bdist.linux-x86_64/egg/bitsandbytes/autograd copying build/lib/bitsandbytes/debug_cli.py -> build/bdist.linux-x86_64/egg/bitsandbytes creating build/bdist.linux-x86_64/egg/bitsandbytes/nn copying build/lib/bitsandbytes/nn/init.py -> build/bdist.linux-x86_64/egg/bitsandbytes/nn copying build/lib/bitsandbytes/nn/modules.py -> build/bdist.linux-x86_64/egg/bitsandbytes/nn copying build/lib/bitsandbytes/main.py -> build/bdist.linux-x86_64/egg/bitsandbytes byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/init.py to init.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/utils.py to utils.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/functional.py to functional.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/sgd.py to sgd.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/init.py to init.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/optimizer.py to optimizer.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/adagrad.py to adagrad.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/adamw.py to adamw.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/rmsprop.py to rmsprop.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/lars.py to lars.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/lamb.py to lamb.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/optim/adam.py to adam.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/cextension.py to cextension.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/autograd/init.py to init.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/autograd/_functions.py to _functions.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/debug_cli.py to debug_cli.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/nn/init.py to init.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/nn/modules.py to modules.cpython-310.pyc byte-compiling build/bdist.linux-x86_64/egg/bitsandbytes/main.py to main.cpython-310.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying bitsandbytes.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying bitsandbytes.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying bitsandbytes.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying bitsandbytes.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying bitsandbytes.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt zip_safe flag not set; analyzing archive contents... bitsandbytes.pycache.cextension.cpython-310: module references file creating 'dist/bitsandbytes-0.35.4-py3.10.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing bitsandbytes-0.35.4-py3.10.egg removing '/usr/lib/python3.10/site-packages/bitsandbytes-0.35.4-py3.10.egg' (and everything under it) creating /usr/lib/python3.10/site-packages/bitsandbytes-0.35.4-py3.10.egg Extracting bitsandbytes-0.35.4-py3.10.egg to /usr/lib/python3.10/site-packages bitsandbytes 0.35.4 is already the active version in easy-install.pth Installing debug_cuda script to /usr/bin

Installed /usr/lib/python3.10/site-packages/bitsandbytes-0.35.4-py3.10.egg Processing dependencies for bitsandbytes==0.35.4 Finished processing dependencies for bitsandbytes==0.35.4`

python -m bitsandbytes results in the following in a different terminal right after "python install"

/home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//debuginfod.archlinux.org'), PosixPath('https')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/etc/gtk-2.0/gtkrc')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/home/theiceleopard/.gtkrc'), PosixPath('/etc/gtk/gtkrc')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/Sessions/1')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/Windows/1')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('@/tmp/.ICE-unix/1114,unix/StormyGamingRig'), PosixPath('local/StormyGamingRig')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/org/freedesktop/DisplayManager/Seat0')} warn( /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/org/freedesktop/DisplayManager/Session1')} warn( CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64... /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cuda_setup/paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/usr/local/cuda/lib64')} warn( WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)! CUDA SETUP: Loading binary /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so... /home/theiceleopard/.local/lib/python3.10/site-packages/bitsandbytes/cextension.py:48: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers and GPU quantization are unavailable. warn( "hipErrorNoBinaryForGpu: Unable to find code object for all current devices!" zsh: IOT instruction (core dumped) python -m bitsandbytes

But in the same terminal after python install

"hipErrorNoBinaryForGpu: Unable to find code object for all current devices!" zsh: IOT instruction (core dumped) python -m bitsandbytes

Gazzoo-byte commented 1 year ago

Hello, not sure if it'll resolve your issue, but I had a similar problem and my workaround was to use export HSA_OVERRIDE_GFX_VERSION=10.3.0 after which I appear to be able to train using dreambooth in a1111. The last command of python -m bitsandbytes still throws an error, but different from what you're seeing - it gives me this instead RuntimeError: CUDA Setup failed despite GPU being available. Inspect the CUDA SETUP outputs aboveto fix your environment! If you cannot find any issues and suspect a bug, please open an issue with detals about your environment: https://github.com/TimDettmers/bitsandbytes/issues