[Bug]: ImportError: libamdhip64.so: cannot enable executable stack as shared object requires: Invalid argument
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
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
I fixed this by using patchelf --clear-execstack libamdhip64.so (and on libhiprtc.so too), after that it loaded and worked. hth.
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 {} \;
It's such a great auto-setup script...