stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: ImportError: libamdhip64.so: cannot enable executable stack as shared object requires: Invalid argument

Open bestbug456 opened this issue 5 months ago • 3 comments

Checklist

  • [x] The issue exists after disabling all extensions
  • [x] The issue exists on a clean installation of webui
  • [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • [x] The issue exists in the current version of the webui
  • [x] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

What happened?

Hello, I'm try to install automatic1111 on my arch linux, I followed the guide at https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs but when I try to run the final script I've the following error `./webui.sh --skip-torch-cuda-test

################################################################ Install script for stable-diffusion + Web UI Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer. ################################################################

################################################################ Running on [] user ################################################################

################################################################ Repo already cloned, using it as install directory ################################################################

################################################################ python venv already activate or run without venv: /[]/[]/[]/stable-diffusion-webui/venv ################################################################

################################################################ Launching launch.py... ################################################################ glibc version is 2.41 Check TCMalloc: libtcmalloc_minimal.so.4 libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/usr/lib/libtcmalloc_minimal.so.4 Python 3.10.18 (main, Jul 5 2025, 09:14:32) [GCC 15.1.1 20250425] Version: v1.10.1 Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2 Launching Web UI with arguments: --skip-torch-cuda-test Traceback (most recent call last): File "/home/bestbug/Documents/stable-diffusion-webui/launch.py", line 48, in main() File "/home/bestbug/Documents/stable-diffusion-webui/launch.py", line 44, in main start() File "/home/bestbug/Documents/stable-diffusion-webui/modules/launch_utils.py", line 465, in start import webui File "/home/bestbug/Documents/stable-diffusion-webui/webui.py", line 13, in initialize.imports() File "/home/bestbug/Documents/stable-diffusion-webui/modules/initialize.py", line 15, in imports import torch # noqa: F401 File "/home/bestbug/Documents/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/init.py", line 239, in from torch._C import * # noqa: F403 ImportError: libamdhip64.so: cannot enable executable stack as shared object requires: Invalid argument ` Can someone help me to figure out what to do? Looking in the open issue I'm not able to find someone that have the invalid argument as error, what should I check? If needed rocm is on version 6.4.1-1 Thanks!

Steps to reproduce the problem

Follow the guide at https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs and run with ./webui.sh --skip-torch-cuda-test

What should have happened?

Webui should start

What browsers do you use to access the UI ?

No response

Sysinfo

the --dump-sysinfo return the same error as mentioned ImportError: libamdhip64.so: cannot enable executable stack as shared object requires: Invalid argument

Console logs

./webui.sh --skip-torch-cuda-test

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on [] user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
python venv already activate or run without venv: /[]/[]/[]/stable-diffusion-webui/venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.41
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/usr/lib/libtcmalloc_minimal.so.4
Python 3.10.18 (main, Jul  5 2025, 09:14:32) [GCC 15.1.1 20250425]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --skip-torch-cuda-test
Traceback (most recent call last):
  File "/home/bestbug/Documents/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/home/bestbug/Documents/stable-diffusion-webui/launch.py", line 44, in main
    start()
  File "/home/bestbug/Documents/stable-diffusion-webui/modules/launch_utils.py", line 465, in start
    import webui
  File "/home/bestbug/Documents/stable-diffusion-webui/webui.py", line 13, in <module>
    initialize.imports()
  File "/home/bestbug/Documents/stable-diffusion-webui/modules/initialize.py", line 15, in imports
    import torch  # noqa: F401
  File "/home/bestbug/Documents/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/__init__.py", line 239, in <module>
    from torch._C import *  # noqa: F403
ImportError: libamdhip64.so: cannot enable executable stack as shared object requires: Invalid argument

Additional information

No response

bestbug456 avatar Jul 05 '25 10:07 bestbug456

I fixed this by using patchelf --clear-execstack libamdhip64.so (and on libhiprtc.so too), after that it loaded and worked. hth.

dlm21 avatar Jul 12 '25 04:07 dlm21

I fixed this by using patchelf --clear-execstack libamdhip64.so (and on libhiprtc.so too), after that it loaded and worked. hth.

This worked great. For anyone else running into this issue later: you can run the following one liner from the projects directory to fix the problem.

find . \( -name "libhiprtc.so" -o -name "libamdhip64.so" \) -exec patchelf --clear-execstack {} \;

Lethja avatar Aug 14 '25 05:08 Lethja

It's such a great auto-setup script...

Hatsune-Cthulhu avatar Sep 09 '25 00:09 Hatsune-Cthulhu