Hello everyone,
I’m having trouble allocating memory for the NPU on my Radxa Airbox when following the instructions on Radxa’s SD3 model deployment guide. Additionally, I have installed the libkcapi1
library using the sudo apt install libkcapi1
command.
To resolve the memory allocation issues, I have tried various memory sharing configurations, including those recommended in the memory allocation guide on Radxa’s website. I also made sure that no container is started in Casa OS that allocates NPU mem.
which is the output when I try to load the model:
$ python3 gr.py
/mnt/NVME/projekte/SD3-Medium-TPU/python_demo/.venv/lib/python3.8/site-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (2.2.2) or chardet (3.0.4) doesn’t match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn’t match a supported "
Running on local URL: http://0.0.0.0:8999
To create a public link, set share=True
in launch()
.
read file models/mmdit.bmodel, size 100000, duration 0.000309, speed 0.301399 GB/s
[BMRT][bmcpu_setup:406] INFO:cpu_lib ‘libcpuop.so’ is loaded.
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:1084] INFO:Loading bmodel from [models/mmdit.bmodel]. Thanks for your patience…
[BMRT][load_bmodel:1023] INFO:pre net num: 0, load net num: 26
[BMRT][bmcpu_setup:406] INFO:cpu_lib ‘libcpuop.so’ is loaded.
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:1084] INFO:Loading bmodel from [models/clip_g.bmodel]. Thanks for your patience…
[BMRT][load_bmodel:1023] INFO:pre net num: 0, load net num: 14
[BMRT][bmcpu_setup:406] INFO:cpu_lib ‘libcpuop.so’ is loaded.
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:1084] INFO:Loading bmodel from [models/clip_l.bmodel]. Thanks for your patience…
[BMRT][load_bmodel:1023] INFO:pre net num: 0, load net num: 34
[BMRT][bmcpu_setup:406] INFO:cpu_lib ‘libcpuop.so’ is loaded.
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:1084] INFO:Loading bmodel from [models/t5.bmodel]. Thanks for your patience…
[BMRT][load_bmodel:1023] INFO:pre net num: 0, load net num: 26
[BMRT][bmcpu_setup:406] INFO:cpu_lib ‘libcpuop.so’ is loaded.
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:1084] INFO:Loading bmodel from [models/vae_decoder.bmodel]. Thanks for your patience…
[BMRT][load_bmodel:1023] INFO:pre net num: 0, load net num: 1
[bmlib_memory][error] bm_alloc_gmem failed, dev_id = 0, size = 0x82100000
[BM_CHECK][error] BM_CHECK_RET fail /workspace/aim-bm1684x-sdk/libsophon/bmlib/src/bmlib_memory.cpp: bm_malloc_device_byte_heap_mask: 705
[BMRT][must_alloc_device_mem:1820] FATAL:device mem alloc failed: size=2182086656[0x82100000] type_len=1 status=5 desc=neuron_mem0
Error: /data/ssd/sd3tpu-main/src/sd3.cc:135
I would appreciate any advice or suggestions from the community on how to properly allocate memory for the NPU or troubleshoot this issue. Thanks in advance for your help!
Best regards,
Matthias