Stable Diffusion Tutorial failure

New Jetson Orin Nano Super owner. Successfully installed the latest OS and Jetpack. Migrated everything from the SD card to SSD (thank you JetsonHacks). Followed the Stable Diffusion Tutorial exactly. The last step failed, and the tail end of the output screen is below. I am at a loss as to how to fix things.

+ local color=green
+ local 'message=[INSTALL] ✅ Install Script of sd-civitai-browser-plus is completed!'
+ case "$color" in
+ echo -e '\033[1;32m[INSTALL] ✅ Install Script of sd-civitai-browser-plus is completed!\033[0m'
[INSTALL] ✅ Install Script of sd-civitai-browser-plus is completed!
+ PYTHONPATH=/opt/stable-diffusion-webui python3 -c from modules import launch_utils; launch_utils.args.skip_python_version_check=True; launch_utils.prepare_environment()
Python 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/stable-diffusion-webui/modules/launch_utils.py", line 387, in prepare_environment
    raise RuntimeError(
RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
The command '/bin/sh -c set -ex     && git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /opt/stable-diffusion-webui     && git -C /opt/stable-diffusion-webui checkout ${STABLE_DIFFUSION_WEBUI_SHA}         && PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" pip3 install httpx==0.24.1 insightface GitPython     && PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" /tmp/install_extensions.sh         https://github.com/dusty-nv/stable-diffusion-webui-tensorrt         https://github.com/Mikubill/sd-webui-controlnet         https://github.com/zanllp/sd-webui-infinite-image-browsing         https://github.com/ahgsql/StyleSelectorXL         https://github.com/thomasasfk/sd-webui-aspect-ratio-helper         https://github.com/BlafKing/sd-civitai-browser-plus     && PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" python3 -c 'from modules import launch_utils; launch_utils.args.skip_python_version_check=True; launch_utils.prepare_environment()'     && /tmp/opencv/install.sh     && sed 's|dict\[str, OptionInfo\]|dict|g' -i $AUTOMATIC1111_ROOT_DIR/modules/options.py     && sed 's|dict\[.*\]|dict|g' -i $AUTOMATIC1111_ROOT_DIR/modules/processing.py     && sed 's|list\[.*\]|list|g' -i $AUTOMATIC1111_ROOT_DIR/modules/processing.py     && sed 's|dict\[.*\]|dict|g' -i $AUTOMATIC1111_ROOT_DIR/modules/script_callbacks.py     && sed 's|list\[.*\]|list|g' -i $AUTOMATIC1111_ROOT_DIR/modules/script_callbacks.py         && cd /opt/stable-diffusion-webui     && PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" python3 launch.py --help     && PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" pip3 show insightface     && PYTHONPATH="$AUTOMATIC1111_ROOT_DIR" python3 -c 'import insightface; print(insightface.__version__);'         && rm -rf /var/lib/apt/lists/*     && apt-get clean' returned a non-zero code: 1
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/mark/jetson-containers/jetson_containers/tag.py", line 58, in <module>
    image = find_container(args.packages[0], prefer_sources=args.prefer, disable_sources=args.disable, user=args.user, quiet=args.quiet)
  File "/home/mark/jetson-containers/jetson_containers/container.py", line 542, in find_container
    return build_container('', package) #, simulate=True)
  File "/home/mark/jetson-containers/jetson_containers/container.py", line 151, in build_container
    status = subprocess.run(cmd.replace(_NEWLINE_, ' '), executable='/bin/bash', shell=True, check=True)  
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'sudo DOCKER_BUILDKIT=0 docker build --network=host --tag stable-diffusion-webui:r36.4.3-stable-diffusion-webui --file /home/mark/jetson-containers/packages/diffusion/stable-diffusion-webui/Dockerfile --build-arg BASE_IMAGE=stable-diffusion-webui:r36.4.3-onnxruntime --build-arg STABLE_DIFFUSION_WEBUI_SHA="master" --build-arg STABLE_DIFFUSION_WEBUI_REF="refs/heads/master" /home/mark/jetson-containers/packages/diffusion/stable-diffusion-webui 2>&1 | tee /home/mark/jetson-containers/logs/20250305_074842/build/stable-diffusion-webui_r36.4.3-stable-diffusion-webui.txt; exit ${PIPESTATUS[0]}' returned non-zero exit status 1.
-- Error:  return code 1
V4L2_DEVICES: 
### DISPLAY environmental variable is already set: ":0"
localuser:root being added to access control list
xauth:  file /tmp/.docker.xauth does not exist
+ sudo docker run --runtime nvidia -it --rm --network host --shm-size=8g --volume /tmp/argus_socket:/tmp/argus_socket --volume /etc/enctune.conf:/etc/enctune.conf --volume /etc/nv_tegra_release:/etc/nv_tegra_release --volume /tmp/nv_jetson_model:/tmp/nv_jetson_model --volume /var/run/dbus:/var/run/dbus --volume /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket --volume /var/run/docker.sock:/var/run/docker.sock --volume /home/mark/jetson-containers/data:/data -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro --device /dev/snd -e PULSE_SERVER=unix:/run/user/1000/pulse/native -v /run/user/1000/pulse:/run/user/1000/pulse --device /dev/bus/usb -e DISPLAY=:0 -v /tmp/.X11-unix/:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth -e XAUTHORITY=/tmp/.docker.xauth --device /dev/i2c-0 --device /dev/i2c-1 --device /dev/i2c-2 --device /dev/i2c-4 --device /dev/i2c-5 --device /dev/i2c-7 --device /dev/i2c-9 --name jetson_container_20250305_083814
docker: 'docker run' requires at least 1 argument

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

See 'docker run --help' for more information
mark@mark-desktop:~$ cd /opt/stable-diffusion-webui && python3 launch.py \
  --data=/data/models/stable-diffusion \
  --enable-insecure-extension-access \
  --xformers \
  --listen \
  --port=7860
bash: cd: /opt/stable-diffusion-webui: No such file or directory```

Hi,

RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

The error indicates your PyTorch doesn’t have CUDA support.
Could you share the command you used and the whole output log so we can give it a check?

Thanks.

AastaLLL,

Thank you. Does Ubuntu log the terminal output somewhere? The output above was all that I could copy/paste from terminal window. Let me explain a bit more of what I did, if that may help.

I flashed a SD card with JetPack 6.2 image. The Orin Nano booted fine, and started asking the normal on-boarding questions. When asked if I wanted Chromium installed, I replied “yes” and that step failed for some reason. The on-boarding continued and I eventually came to the Nvidia screen. I was then prompted for available software updates, which I accepted. I manually installed Chromium. At that point, I migrated the SD card image to a SSD. I rebooted the system off the SSD.

I went to the Nvidia AI lab tutorial website to walk through the steps necessary to install Stable Diffusion.

First step:
git clone GitHub - dusty-nv/jetson-containers: Machine Learning Containers for NVIDIA Jetson and JetPack-L4T
bash jetson-containers/install.sh

That appeared to work just fine.

Second step:
jetson-containers run $(autotag stable-diffusion-webui)

This step takes a long time and streams a great deal of text on the terminal. This step failed for the reason indicated.

I am not a Ubuntu user. I imagine I could repeat these steps and see if I can redirect the output stream to a file if there is not already a log file somewhere.

sincerely,
Mark

I think I am getting the same error doing jetson-containers run $(autotag stable-diffusion-webui)
Looks like it is trying to pull a file, but just getting a web page about the archive
Step 8/9 : RUN curl -L Comfy-Org/stable-diffusion-v1-5-archive · Hugging Face -o /data/models/stable-diffusion
—> Running in b3c9e8cedac6
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0Warning: Failed to create the file /data/models/stable-diffusion: No such file
Warning: or directory
22 70059 22 15579 0 0 26043 0 0:00:02 --:–:-- 0:00:02 26095
curl: (23) Failure writing output to destination
The command ‘/bin/sh -c curl -L Comfy-Org/stable-diffusion-v1-5-archive · Hugging Face -o /data/models/stable-diffusion’ returned a non-zero code: 23

Hi, both

Thanks for your feedback.

We are testing this issue internally.
Will update more info to you later.

billpreston,

I found this YouTube video very helpful: https://www.youtube.com/watch?v=-PjMC0gyH9s

He starts with the text generation AI tutorial, and that works fine. He progresses to the image generation AI and basically runs into the same problem we experienced.

Instead of the suggested command:
jetson-containers run $(autotag stable-diffusion-webui)

He instead explicitly pulls a particular container:
jetson-containers run dustynv/stable-diffusion-webui:r36.2.0

That worked for me, and I am not smart enough to figure out why the suggested command fails. Hope this helps.

Thanks. I have run it through the pull container method before. A lot of the stuff we the Jetson they suggest run it with containers, not natively. For many native things you run into problems and the retort is always “use the containers”. So with the 6.2 reflash I decided to try all containers. I didn’t make it too far. Comfy UI appears to build with the container, and comfy /flux has a good page here. Flux & ComfyUI - NVIDIA Jetson AI Lab if you are looking for upgrades to stable diffusion.

Hi,

We can build nanosam on JetPack 6.2 successfully.
Please find below for the steps:

Set up

git clone https://github.com/dusty-nv/jetson-containers.git
bash jetson-containers/install.sh

Build

sudo nvpmodel -m 0
jetson-containers build stable-diffusion-webui

Or run the prebuilt image:

jetson-containers run daivdl487/stable-diffusion-webui:r36.4.3

Thanks

No Joy in Mudville here doing the build.
I assume for nvpmodel you meant sudo nvpmodel -m 0
– L4T_VERSION=36.4.3 JETPACK_VERSION=6.2 CUDA_VERSION=12.6 PYTHON_VERSION=3.10 LSB_RELEASE=22.04 (jammy)

Eventually I git the below
The command ‘/bin/sh -c /tmp/onnxruntime/install.sh || /tmp/onnxruntime/build.sh’ returned a non-zero code: 1
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/mnt/data/jetson_containers/jetson_containers/build.py”, line 120, in
build_container(args.name, args.packages, args.base, args.build_flags, args.build_args, args.simulate, args.skip_tests, args.test_only, args.push, args.no_github_api, args.skip_packages)
File “/mnt/data/jetson_containers/jetson_containers/container.py”, line 151, in build_container
status = subprocess.run(cmd.replace(NEWLINE, ’ ‘), executable=’/bin/bash’, shell=True, check=True)
File “/usr/lib/python3.10/subprocess.py”, line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘DOCKER_BUILDKIT=0 docker build --network=host --tag stable-diffusion-webui:r36.4.3-onnxruntime --file /mnt/data/jetson_containers/packages/ml/onnxruntime/Dockerfile --build-arg BASE_IMAGE=stable-diffusion-webui:r36.4.3-tensorrt --build-arg ONNXRUNTIME_VERSION=“1.21.0” --build-arg ONNXRUNTIME_BRANCH=“v1.21.0” --build-arg ONNXRUNTIME_FLAGS=“–allow_running_as_root” /mnt/data/jetson_containers/packages/ml/onnxruntime 2>&1 | tee /mnt/data/jetson_containers/logs/20250401_125444/build/stable-diffusion-webui_r36.4.3-onnxruntime.txt; exit ${PIPESTATUS[0]}’ returned non-zero exit status 1.

Did a fresh pull today. It fails at onyxruntime build
│ L4T_VERSION 36.4.0 │ JETPACK_VERSION 6.1 │
│ CUDA_VERSION 12.6 │ PYTHON_VERSION 3.10 │
│ SYSTEM_ARCH aarch64 │ LSB_RELEASE 22.04

Cloning into ‘/opt/onnxruntime’…
[ 94%] Building CUDA object CMakeFiles/onnxruntime_providers_cuda.dir/opt/onnxruntime/onnxruntime/contrib_ops/cuda/bert/flash_attention/
flash_fwd_hdim192_fp16_sm80.cu.o
Killed
gmake[2]: *** [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:6203: CMakeFiles/onnxruntime_providers_cuda.dir/opt/onnxruntime/onnx
runtime/contrib_ops/cuda/bert/flash_attention/flash_fwd_hdim128_bf16_sm80.cu.o] Error 137
gmake[2]: *** Waiting for unfinished jobs…
Killed
gmake[2]: *** [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:6218: CMakeFiles/onnxruntime_providers_cuda.dir/opt/onnxruntime/onnx
runtime/contrib_ops/cuda/bert/flash_attention/flash_fwd_hdim128_fp16_sm80.cu.o] Error 137
Killed
gmake[2]: *** [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:6233: CMakeFiles/onnxruntime_providers_cuda.dir/opt/onnxruntime/onnx
runtime/contrib_ops/cuda/bert/flash_attention/flash_fwd_hdim160_bf16_sm80.cu.o] Error 137
Killed
gmake[2]: *** [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:6248: CMakeFiles/onnxruntime_providers_cuda.dir/opt/onnxruntime/onnx
runtime/contrib_ops/cuda/bert/flash_attention/flash_fwd_hdim160_fp16_sm80.cu.o] Error 137
gmake[1]: *** [CMakeFiles/Makefile2:2710: CMakeFiles/onnxruntime_providers_cuda.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Traceback (most recent call last):
File “/opt/onnxruntime/tools/ci_build/build.py”, line 3312, in
sys.exit(main())
File “/opt/onnxruntime/tools/ci_build/build.py”, line 3207, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File “/opt/onnxruntime/tools/ci_build/build.py”, line 2006, in build_targets
run_subprocess(cmd_args, env=env)
File “/opt/onnxruntime/tools/ci_build/build.py”, line 906, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
File “/opt/onnxruntime/tools/python/util/run.py”, line 50, in run
completed_process = subprocess.run(
File “/usr/lib/python3.10/subprocess.py”, line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[’/usr/local/bin/cmake’, ‘–build’, ‘/opt/onnxruntime/build/Linux/Release’, ‘–config’, ‘Release’, ‘–’, ‘-j6’]’ returned non-zero exit status 2.
The command ‘/bin/sh -c /tmp/onnxruntime/install.sh || /tmp/onnxruntime/build.sh’ returned a non-zero code: 1
[12:03:39] Failed building: stable-diffusion-webui

Traceback (most recent call last):
File “/mnt/data/jetson_containers/jetson_containers/build.py”, line 127, in
build_container(**vars(args))
File “/mnt/data/jetson_containers/jetson_containers/container.py”, line 166, in build_container
status = subprocess.run(cmd.replace(NEWLINE, ’ ‘), executable=’/bin/bash’, shell=True, check=True)
File “/usr/lib/python3.10/subprocess.py”, line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘DOCKER_BUILDKIT=0 docker build --network=host --tag stable-diffusion-webui:r36.4.0-onnxruntime --file /mnt/data/jetson_containers/packages/ml/onnxruntime/Dockerfile --build-arg BASE_IMAGE=stable-diffusion-webui:r36.4.0-tensorrt --build-arg ONNXRUNTIME_VERSION=“1.21.0” --build-arg ONNXRUNTIME_BRANCH=“v1.21.0” --build-arg ONNXRUNTIME_FLAGS=“–allow_running_as_root” /mnt/data/jetson_containers/packages/ml/onnxruntime 2>&1 | tee /mnt/data/jetson_containers/logs/20250410_110728/build/stable-diffusion-webui_r36.4.0-onnxruntime.txt; exit ${PIPESTATUS[0]}’ returned non-zero exit status 1.

On the latest pull, changing the curl in the dockerfile allows it to pull, build and run. However it throughs the following error when I try to generate and image. Looks like an xformers cuda problem maybe?
EDIT TO GET IT BUILDING AND RUNNING

Add the correct link for stable diffusion download

#RUN curl -L Comfy-Org/stable-diffusion-v1-5-archive · Hugging Face -o /data/models/stable-diffusion
RUN mkdir -p /data/models/stable-diffusion && curl -L https://huggingface.co/Comfy-Org/stable-diffusion-v1-5-archive/resolve/main/v1-5-pruned-emaonly.safetensors -o /data/models/stable-diffusion/v1-5-pruned-emaonly.safetensors

ERROR
NotImplementedError: No operator found for memory_efficient_attention_forward with inputs: query : shape=(2, 4096, 8, 40) (torch.float16) key : shape=(2, 4096, 8, 40) (torch.float16) value : shape=(2, 4096, 8, 40) (torch.float16) attn_bias : <class ‘NoneType’> p : 0.0 fa3F@0.0.0 is not supported because: min(query.shape[-1], value.shape[-1]) < 64 xFormers wasn’t build with CUDA support requires device with capability > (9, 0) but your GPU has capability (8, 7) (too old) operator wasn’t built - see python -m xformers.info for more info only head-dim 64, 128, 192 or 256 is supported fa2F@2.5.7-pt is not supported because: xFormers wasn’t build with CUDA support cutlassF-pt is not supported because: xFormers wasn’t build with CUDA support

Latest pull, it now builds with no editing, but when I try to use the ai I get this NotImplementedError: No operator found for memory_efficient_attention_forward with inputs: query : shape=(2, 4096, 8, 40) (torch.float16) key : shape=(2, 4096, 8, 40) (torch.float16) value : shape=(2, 4096, 8, 40) (torch.float16) attn_bias : <class ‘NoneType’> p : 0.0 fa3F@0.0.0 is not supported because: min(query.shape[-1], value.shape[-1]) < 64 xFormers wasn’t build with CUDA support requires device with capability > (9, 0) but your GPU has capability (8, 7) (too old) operator wasn’t built - see python -m xformers.info for more info only head-dim 64, 128, 192 or 256 is supported fa2F@2.5.7-pt is not supported because: xFormers wasn’t build with CUDA support cutlassF-pt is not supported because: xFormers wasn’t build with CUDA support

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.