rockchip-linux / rknn-toolkit

BSD 3-Clause "New" or "Revised" License
831 stars 175 forks source link

npu_transfer_proxy does not function with RaspPi as host #2

Open jonsmirl opened 5 years ago

jonsmirl commented 5 years ago

The ARM version of npu_transfer_proxy appears to assume that it is running on a RK3399 and it looks for the internal RK1808. We tried putting a NPU compute stick into a Raspberry Pi and it won't work. npu_transfer_proxy works fine on x86 and Mac host.

fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 write(1, "I NPUTransfer: Starting NPU Tran"..., 140I NPUTransfer: Starting NPU Transfer Proxy, Transfer version 1.9.5 (e8ffa6c@2019-07-01T11:43:29), devid = 0123456789ABCDEF, pid = 2752:2750 ) = 140 rt_sigaction(SIGCHLD, {sa_handler=SIG_IGN, sa_mask=[CHLD], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 faccessat(AT_FDCWD, "/sys/devices/platform/ff690000.efuse/rockchip-efuse0/nvmem", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/sys/devices/system/cpu/soc", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/sys/devices/system/cpu/socid", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/proc/device-tree/compatible", R_OK) = 0 openat(AT_FDCWD, "/proc/device-tree/compatible", O_RDONLY) = 8 fstat(8, {st_mode=S_IFREG|0444, st_size=35, ...}) = 0 read(8, "raspberrypi,4-model-b\0brcm,bcm28"..., 4096) = 35 read(8, "", 4096) = 0

jonsmirl commented 5 years ago

Has anyone looked into this? This should be simple to fix but problem is in closed source code so I can not fix on my own.

Jerzha commented 5 years ago

We don't support RaspPi in 1808 negative mode communication via npu_transfer_proxy, npu_transfer_proxy can't running in arm32. But you can try in positive mode which is communication via usb-eth. In this mode 1808 has a full control with CPU and NPU.

jonsmirl commented 5 years ago

npu_transfer_proxy is small 300KB app, can you open source it?

Jerzha commented 5 years ago

Sorry, the department responsible for NPU did not open source to us :( We will strongly suggest them to open source it.

jonsmirl commented 5 years ago

There should not be any secrets in npu_transfer_proxy. Open sourcing will allow the code to be ported to platforms like 32b RaspPi without you doing the work.

nikitos1550 commented 5 years ago

Hello! @Jerzha Could you explain more about positive mode which is communication via usb-eth ? Also, how is it going with opensourcing npu_transfer_proxy tool?