The perilous adventure of setting up Stable Diffusion A1111 on a Jetson Nano 4GB

Dear all,

I am working for several days to try to have a Stable Diffusion (A1111 or Forge) running on my 4GB Jetson Nano.

I am here to share what I was able to achieve and looking for your help to overcome, I hope, the final step !

The closest solution I found is:

With the previous steps, the install of the Stable Diffusion is able to proceed smoothly, and it can use torch with CUDA enabled (a mandatory step to use all the potentialities of the Jetson, as I understood).

The problem appears when the SD installation prepares the model (in this case the SD1.5 pruned v1-5-pruned-emaonly.ckpt · runwayml/stable-diffusion-v1-5 at main), in particular during the “loading weights” phase. After freezing, the bash process is killed, i suppose due to a Out Of Memory issue, but I don’t know how to diagnose it properly.

I have tried to add the recommended arguments for low configurations or optimizing for NVIDIA GPUs running SD: --lowvram, --cuda-stream --pin-shared-memory but in anycase it looks like a OOM issue.

Do you think about anything that might be able to make it work ?

Thanks a lot for your support,
Kind regards

1 Like


First, thanks for sharing the details.
This should help other users a lot.

As you already know, killed is usually caused by the OOM.
You can confirm this by running tegrastate on the other console concurrently.

$ sudo tegrastats

It is possible to increase memory by creating a swap but these kinds of memory can be used by the CPU.
Please check the below comment for info about creating a swap:


Dear AastaLLL,
Thank you for your answer, I performed the tegrastats log (logfile in attachments, log.txt (236.5 KB)), and as you can see in line 1318, both the RAM and the SWAP was full.

I am trying to increase the swap size as per your link, but I am not sure of the location of the swap file.
I have a /var/swap file of 4GB, is it this one ?

How your proposition to modify it is different from doing the steps mentioned in, in section “Enlarge memory swap.” ?

Thanks again,
Kind regards,


swap file is to use storage space as memory.
So please create it on the available storage space, ex. external SSD.

The mechanism is similar.
You can also increase the current swap file to see if it helps.


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