Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nv_small FPGA Mapping Workflow - Max's Blog #3

Open
VVViy opened this issue Oct 18, 2018 · 162 comments
Open

nv_small FPGA Mapping Workflow - Max's Blog #3

VVViy opened this issue Oct 18, 2018 · 162 comments

Comments

@VVViy
Copy link
Owner

VVViy commented Oct 18, 2018

https://vvviy.github.io/2018/09/17/nv_small-FPGA-Mapping-Workflow-II/

Keep self busy.

@Jwy-jump
Copy link

$ petalinux-build会报错:
| make[1]: *** [Makefile:25: xuartps_sinit.o] Error 1
| In file included from ../../../include/xil_printf.h:12:0,
| from ../../../include/xil_io.h:65,
| from xuartps_hw.h:73,
| from xuartps.h:188,
| from xuartps.c:60:
| ../../../include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /* prevent circular inclusions /
|
| make[1]: *** [Makefile:25: xuartps.o] Error 1
| In file included from ../../../include/xil_printf.h:12:0,
| from ../../../include/xil_io.h:65,
| from xuartps_hw.h:73,
| from xuartps_hw.c:53:
| ../../../include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /
prevent circular inclusions /
|
| make[1]: *** [Makefile:25: xuartps_hw.o] Error 1
| In file included from ../../../include/xil_printf.h:12:0,
| from ../../../include/xil_io.h:65,
| from xuartps_hw.h:73,
| from xuartps.h:188,
| from xuartps_options.c:58:
| ../../../include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /
prevent circular inclusions /
|
| make[1]: *** [Makefile:25: xuartps_options.o] Error 1
| In file included from ../../../include/xil_printf.h:12:0,
| from ../../../include/xil_io.h:65,
| from xuartps_hw.h:73,
| from xuartps.h:188,
| from xuartps_intr.c:55:
| ../../../include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /
prevent circular inclusions /
|
| make[1]: *** [Makefile:25: xuartps_intr.o] Error 1
| make[1]: Target 'libs' not remade because of errors.
| make: *** [Makefile:30: psu_pmu_0/libsrc/uartps_v3_5/src/make.libs] Error 2
| make: Target 'all' not remade because of errors.
|
| 16:47:13 Build Finished (took 2s.877ms)
|
| Building '/pmu-firmware'
| 16:47:13 **** Build of configuration Release for project pmu-firmware ****
| make all
| Building file: ../src/idle_hooks.c
| Invoking: MicroBlaze gcc compiler
| mb-gcc -Wall -O2 -c -fmessage-length=0 -MT"src/idle_hooks.o" -Os -flto -ffat-lto-objects -I../../pmu-firmware_bsp/psu_pmu_0/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mcpu=v9.2 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/idle_hooks.d" -MT"src/idle_hooks.o" -o "src/idle_hooks.o" "../src/idle_hooks.c"
| In file included from ../../pmu-firmware_bsp/psu_pmu_0/include/xil_printf.h:12:0,
| from ../../pmu-firmware_bsp/psu_pmu_0/include/xil_io.h:65,
| from ../../pmu-firmware_bsp/psu_pmu_0/include/sleep.h:37,
| from ../src/idle_hooks.c:35:
| ../../pmu-firmware_bsp/psu_pmu_0/include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /
prevent circular inclusions /
|
| In file included from ../src/pm_node_idle.h:39:0,
| from ../src/idle_hooks.c:36:
| ../../pmu-firmware_bsp/psu_pmu_0/include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /
prevent circular inclusions /
|
| In file included from ../../pmu-firmware_bsp/psu_pmu_0/include/xipipsu.h:104:0,
| from ../src/xpfw_ipi_manager.h:37,
| from ../src/pm_common.h:43,
| from ../src/idle_hooks.c:37:
| ../../pmu-firmware_bsp/psu_pmu_0/include/xipipsu_hw.h:66:29: error: 'XPAR_XIPIPSU_NUM_TARGETS' undeclared here (not in a function)
| #define XIPIPSU_MAX_TARGETS XPAR_XIPIPSU_NUM_TARGETS
| ^
| ../../pmu-firmware_bsp/psu_pmu_0/include/xipipsu.h:129:28: note: in expansion of macro 'XIPIPSU_MAX_TARGETS'
| XIpiPsu_Target TargetList[XIPIPSU_MAX_TARGETS] ; /
* < List of IPI Targets /
| ^~~~~~~~~~~~~~~~~~~
| In file included from ../src/xpfw_ipi_manager.h:39:0,
| from ../src/pm_common.h:43,
| from ../src/idle_hooks.c:37:
| ../../pmu-firmware_bsp/psu_pmu_0/include/xparameters.h:1:0: error: unterminated #ifndef
| #ifndef XPARAMETERS_H /
prevent circular inclusions */
| ERROR: pmu-firmware compile failed.
|
| make: *** [src/subdir.mk:183: src/idle_hooks.o] Error 1
|
| 16:47:14 Build Finished (took 180ms)
|
| Invoking scanner config builder on project
| WARNING: /home/jwy/dlaproject/dla/build/tmp/work/plnx_aarch64-xilinx-linux/pmu-firmware/2017.4+gitAUTOINC+77448ae629-r0/temp/run.do_compile.30714:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /home/jwy/dlaproject/dla/build/tmp/work/plnx_aarch64-xilinx-linux/pmu-firmware/2017.4+gitAUTOINC+77448ae629-r0/temp/log.do_compile.30714)
ERROR: Task (/home/jwy/opt/pkg/petalinux/components/yocto/source/aarch64/layers/meta-xilinx-tools/recipes-bsp/pmu/pmu-firmware_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2605 tasks of which 2377 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/jwy/opt/pkg/petalinux/components/yocto/source/aarch64/layers/meta-xilinx-tools/recipes-bsp/pmu/pmu-firmware_git.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project

@VVViy
Copy link
Owner Author

VVViy commented Dec 27, 2018

@JiawenYang
用的什么开发板?BD里uart选了0,1还是both?使用SDK环境生成bsp了吗?

@qinzhiy
Copy link

qinzhiy commented Dec 29, 2018

@VVViy
@JiawenYang
用的什么开发板?BD里uart选了0,1还是both?使用SDK环境生成bsp了吗?

用的zcu102,BD里uart选的both,SDK环境下生成bsp,hello world工程正确输出

@VVViy
Copy link
Owner Author

VVViy commented Dec 29, 2018

@open2mind
@JiawenYang
您二位不是同一人吧?
如果是SDK生成的bsp,且能正常输出,那就要根据检查一下SDK里的驱动声明文件.h,因为我是使用hdf文件直接编译的,相关bsp文件会自动download,所以不太了解SDK生成bsp后,petalinux是否需要额外设置,看错误信息应该是SDK那边的声明有点问题,您得自己debug了。

@qinzhiy
Copy link

qinzhiy commented Dec 29, 2018

@VVViy
@open2mind
@JiawenYang
您二位不是同一人吧?
如果是SDK生成的bsp,且能正常输出,那就要根据检查一下SDK里的驱动声明文件.h,因为我是使用hdf文件直接编译的,相关bsp文件会自动download,所以不太了解SDK生成bsp后,petalinux是否需要额外设置,看错误信息应该是SDK那边的声明有点问题,您得自己debug了。
我俩是一起做的小伙伴:P 我们不是用SDK生成的bsp,也是直接使用hdf编译的,SDK只是佐证一下硬件连接

@VVViy
Copy link
Owner Author

VVViy commented Dec 29, 2018

@open2mind

@VVViy
@open2mind
@JiawenYang
您二位不是同一人吧?
如果是SDK生成的bsp,且能正常输出,那就要根据检查一下SDK里的驱动声明文件.h,因为我是使用hdf文件直接编译的,相关bsp文件会自动download,所以不太了解SDK生成bsp后,petalinux是否需要额外设置,看错误信息应该是SDK那边的声明有点问题,您得自己debug了。
我俩是一起做的小伙伴:P 我们不是用SDK生成的bsp,也是直接使用hdf编译的,SDK只是佐证一下硬件连接

哦,那了解了,这个错误是在第一次build时就存在?

@Jwy-jump
Copy link

Jwy-jump commented Dec 29, 2018

@@VVViy是第一次Build出现的,您说这个错误和什么有关,版本都用的和你的一样的?不知道为啥?

@Jwy-jump
Copy link

@VVViy

@VVViy
Copy link
Owner Author

VVViy commented Dec 29, 2018

@JiawenYang
是第一次Build出现的,您说这个错误和什么有关,版本都用的和你的一样的?不知道为啥?

看错误信息,都是报的SDK 驱动文件那边错误,我以为你们是用SDK做的bsp。一个师弟也走过上面流程是没出现过这种错误的,你看看这个链接里面设置有没有帮助https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2018-2-build-crash-xparameters-h-cut-off/td-p/881843

@Jwy-jump
Copy link

Jwy-jump commented Dec 29, 2018

谢谢,这个链接我找到过,仍然没解决?您可不可以将您的工程共享出来或者hdf共享出来,我排除一下问题。我的qq:1565519979@VVViy

@VVViy
Copy link
Owner Author

VVViy commented Dec 29, 2018

@JiawenYang
谢谢,这个链接我找到过,仍然没解决?您可不可以将您的工程共享出来或者hdf共享出来,我排除一下问题。我的qq:1565519979

共享工程这个事情,确实是没办法,如果是我个人项目,我写blog时就share了,NVDLA本来就是开源项目。但是这活是公司项目的一块,里边还有其他东西,我要是share出去,那就违规了,所以见谅了。

@Jwy-jump
Copy link

@VVViy

@JiawenYang
谢谢,这个链接我找到过,仍然没解决?您可不可以将您的工程共享出来或者hdf共享出来,我排除一下问题。我的qq:1565519979

共享工程这个事情,确实是没办法,如果是我个人项目,我写blog时就share了,NVDLA本来就是开源项目。但是这活是公司项目的一块,里边还有其他东西,我要是share出去,那就违规了,所以见谅了。

好吧,ok,可以理解。我在查查怎么解决吧,thanks !

@VVViy
Copy link
Owner Author

VVViy commented Dec 29, 2018

@JiawenYang

@VVViy

@JiawenYang
谢谢,这个链接我找到过,仍然没解决?您可不可以将您的工程共享出来或者hdf共享出来,我排除一下问题。我的qq:1565519979

共享工程这个事情,确实是没办法,如果是我个人项目,我写blog时就share了,NVDLA本来就是开源项目。但是这活是公司项目的一块,里边还有其他东西,我要是share出去,那就违规了,所以见谅了。

好吧,ok,可以理解。我在查查怎么解决吧,thanks !

我在前一篇vivado project博客里刚更新了一幅BD的结构图,你可以参考一下。

@Jwy-jump
Copy link

@VVViy
对了,我还想问您个问题,linux里面还需要装vivado吗?
目前是在win10的vivado建立好hdf,然后拷贝到ubuntu16.04的petalinux里。

@Jwy-jump
Copy link

部分错误log如下:
DEBUG: Executing python function xsct_externalsrc_compile_prefunc
NOTE: pmu-firmware: compiling from external source tree /home/jwy/opt/pkg/petalinux/tools/hsm/data/embeddedsw
DEBUG: Python function xsct_externalsrc_compile_prefunc finished
DEBUG: Executing shell function do_compile
Starting xsdk. This could take few seconds... Picked up _JAVA_OPTIONS: -Duser.home=/home/jwy/dlaproject/1229/build/tmp/xsctenv
done
'pmu-firmware_hwproj' will not be imported... [ALREADY EXIST]
'pmu-firmware' will not be imported... [ALREADY EXIST]
'pmu-firmware_bsp' will not be imported... [ALREADY EXIST]
Building '/pmu-firmware_bsp'

@VVViy
Copy link
Owner Author

VVViy commented Dec 30, 2018

@JiawenYang

@VVViy
对了,我还想问您个问题,linux里面还需要装vivado吗?
目前是在win10的vivado建立好hdf,然后拷贝到ubuntu16.04的petalinux里。

这个无所谓的,我也是Windows+Linux联合开发。

@VVViy
Copy link
Owner Author

VVViy commented Dec 30, 2018

@JiawenYang
部分错误log如下:
DEBUG: Executing python function xsct_externalsrc_compile_prefunc
NOTE: pmu-firmware: compiling from external source tree /home/jwy/opt/pkg/petalinux/tools/hsm/data/embeddedsw
DEBUG: Python function xsct_externalsrc_compile_prefunc finished
DEBUG: Executing shell function do_compile
Starting xsdk. This could take few seconds... Picked up _JAVA_OPTIONS: -Duser.home=/home/jwy/dlaproject/1229/build/tmp/xsctenv
done
'pmu-firmware_hwproj' will not be imported... [ALREADY EXIST]
'pmu-firmware' will not be imported... [ALREADY EXIST]
'pmu-firmware_bsp' will not be imported... [ALREADY EXIST]
Building '/pmu-firmware_bsp'

您这问题太诡异了,怎么还有python和Java,装的petalinux 2018?

@ghost
Copy link

ghost commented Feb 2, 2019

why?
petalinux-build failed like this?
make: *** No rule to make target 'modules_install'. Stop.
ERROR: oe_runmake failed

@VVViy
Copy link
Owner Author

VVViy commented Feb 2, 2019

@peterzh2018888
why?
petalinux-build failed like this?
make: *** No rule to make target 'modules_install'. Stop.
ERROR: oe_runmake failed

按照blog里的流程,环境安装正确性你验证通过了吗?

@ghost
Copy link

ghost commented Feb 2, 2019

@VVViy

@peterzh2018888
why?
petalinux-build failed like this?
make: *** No rule to make target 'modules_install'. Stop.
ERROR: oe_runmake failed

按照blog里的流程,环境安装正确性你验证通过了吗
pass. but, still, make: *** No rule to make target 'modules_install'. Stop.

@VVViy
Copy link
Owner Author

VVViy commented Feb 2, 2019

@peterzh2018888
[INFO] building opendla
[INFO] sourcing bitbake
INFO: bitbake opendla
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:00
Loaded 3438 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:04
Parsing of 2553 .bb files complete (2513 cached, 40 parsed). 3442 targets, 139 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:00
Checking sstate mirror object availability: 100% |###########################################################################################################################################| Time: 0:00:05
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: opendla-1.0-r0 do_install: oe_runmake failed
ERROR: opendla-1.0-r0 do_install: Function failed: do_install (log file is located at /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/log.do_install.22653)
ERROR: Logfile of failure stored in: /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/log.do_install.22653
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-kernel/dtc/dtc_1.4.4.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/gcc-runtime_7.2.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/gcc-cross_7.2.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/binutils/binutils-cross_2.29.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/libgcc_7.2.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['dtc-native', 'pseudo-native', 'kern-tools-native', 'gcc-runtime', 'gcc-cross-aarch64', 'binutils-cross-aarch64', 'pkgconfig-native', 'quilt-native', 'bc-native', 'lzop-native', 'xz-native', 'kmod-native', 'libgcc', 'u-boot-mkimage-native', 'glibc', 'flex-native', 'bison-native', 'linux-libc-headers', 'autoconf-native', 'gnu-config-native', 'automake-native', 'mpfr-native', 'libtool-native', 'texinfo-dummy-native', 'gmp-native', 'zlib-native', 'libmpc-native', 'lzo-native', 'gettext-minimal-native', 'gtk-doc-native', 'openssl-native', 'm4-native', 'makedepend-native', 'cryptodev-linux-native', 'xproto-native', 'util-macros-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| NOTE: make -j 2 KERNEL_SRC=/home/zhpt/aidla/aidla/build/tmp/work-shared/plnx-zynqmp/kernel-source DEPMOD=echo MODLIB=/home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/image/lib/modules/4.14.0-xilinx-v2018.2 CC=aarch64-xilinx-linux-gcc -fuse-ld=bfd LD=aarch64-xilinx-linux-ld.bfd O=/home/zhpt/aidla/aidla/build/tmp/work-shared/plnx-zynqmp/kernel-build-artifacts modules_install
| make: *** No rule to make target 'modules_install'. Stop.
| ERROR: oe_runmake failed
| WARNING: /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/run.do_install.22653:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_install (log file is located at /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/log.do_install.22653)
ERROR: Task (/home/zhpt/aidla/aidla/project-spec/meta-user/recipes-modules/opendla/opendla.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 728 tasks of which 723 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/zhpt/aidla/aidla/project-spec/meta-user/recipes-modules/opendla/opendla.bb:do_install
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build opendla

Apparently,u need to check opendla.bb recipe(intutionly,i think u write wrong SRC_URI).
I did not encounter such problem,u have to google it and debug it.

@honorpeter
Copy link

@VVViy 我的opendla.bb是这样写的 :
SUMMARY = "Recipe for build an external opendla Linux kernel module"
SECTION = "PETALINUX/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
SRC_URI = "file://Makefile
file://cdp.c
file://bdma.c
file://cache.c
file://engine_isr.c
file://common.c
file://nvdla_core_callbacks.c
file://pdp.c
file://conv.c
file://engine.c
file://nvdla_gem.c
file://rubik.c
file://engine_data.c
file://scheduler.c
file://engine_debug.c
file://sdp.c
file://dla_engine_internal.h
file://opendla_initial.h
file://dla_interface.h
file://opendla_small.h
file://common.h
file://dla_sched.h
file://dla_debug.h
file://dla_engine.h
file://engine_debug.h
file://nvdla_linux.h
file://opendla.h
"
inherit module
S = "${WORKDIR}"

The inherit of module.bbclass will automatically name module packages with

@VVViy 仔细检查了,还是这个错误。
make: *** No rule to make target 'modules_install'. Stop.
我用的2018.2,但是还是可以借鉴下,看Xilinx UG1144上写的,需要添加do install()...,但是不知道针对咱们这个opendla这样的用法该怎么写才好。能把您的opendla.bb写的全部内容分享下吗。谢谢

@honorpeter
Copy link

@VVViy

@peterzh2018888
[INFO] building opendla
[INFO] sourcing bitbake
INFO: bitbake opendla
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:00
Loaded 3438 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:04
Parsing of 2553 .bb files complete (2513 cached, 40 parsed). 3442 targets, 139 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:00
Checking sstate mirror object availability: 100% |###########################################################################################################################################| Time: 0:00:05
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: opendla-1.0-r0 do_install: oe_runmake failed
ERROR: opendla-1.0-r0 do_install: Function failed: do_install (log file is located at /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/log.do_install.22653)
ERROR: Logfile of failure stored in: /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/log.do_install.22653
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-kernel/dtc/dtc_1.4.4.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/gcc-runtime_7.2.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/gcc-cross_7.2.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/binutils/binutils-cross_2.29.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/libgcc_7.2.bb:do_populate_sysroot', 'virtual:native:/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb:do_populate_sysroot', '/home/zhpt/petalinux/components/yocto/source/aarch64/layers/core/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['dtc-native', 'pseudo-native', 'kern-tools-native', 'gcc-runtime', 'gcc-cross-aarch64', 'binutils-cross-aarch64', 'pkgconfig-native', 'quilt-native', 'bc-native', 'lzop-native', 'xz-native', 'kmod-native', 'libgcc', 'u-boot-mkimage-native', 'glibc', 'flex-native', 'bison-native', 'linux-libc-headers', 'autoconf-native', 'gnu-config-native', 'automake-native', 'mpfr-native', 'libtool-native', 'texinfo-dummy-native', 'gmp-native', 'zlib-native', 'libmpc-native', 'lzo-native', 'gettext-minimal-native', 'gtk-doc-native', 'openssl-native', 'm4-native', 'makedepend-native', 'cryptodev-linux-native', 'xproto-native', 'util-macros-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| NOTE: make -j 2 KERNEL_SRC=/home/zhpt/aidla/aidla/build/tmp/work-shared/plnx-zynqmp/kernel-source DEPMOD=echo MODLIB=/home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/image/lib/modules/4.14.0-xilinx-v2018.2 CC=aarch64-xilinx-linux-gcc -fuse-ld=bfd LD=aarch64-xilinx-linux-ld.bfd O=/home/zhpt/aidla/aidla/build/tmp/work-shared/plnx-zynqmp/kernel-build-artifacts modules_install
| make: *** No rule to make target 'modules_install'. Stop.
| ERROR: oe_runmake failed
| WARNING: /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/run.do_install.22653:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_install (log file is located at /home/zhpt/aidla/aidla/build/tmp/work/plnx_zynqmp-xilinx-linux/opendla/1.0-r0/temp/log.do_install.22653)
ERROR: Task (/home/zhpt/aidla/aidla/project-spec/meta-user/recipes-modules/opendla/opendla.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 728 tasks of which 723 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/zhpt/aidla/aidla/project-spec/meta-user/recipes-modules/opendla/opendla.bb:do_install
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build opendla

Apparently,u need to check opendla.bb recipe(intutionly,i think u write wrong SRC_URI).
I did not encounter such problem,u have to google it and debug it.

@VVViy 我的opendla.bb是这样写的 :
SUMMARY = "Recipe for build an external opendla Linux kernel module"
SECTION = "PETALINUX/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
SRC_URI = "file://Makefile
file://cdp.c
file://bdma.c
file://cache.c
file://engine_isr.c
file://common.c
file://nvdla_core_callbacks.c
file://pdp.c
file://conv.c
file://engine.c
file://nvdla_gem.c
file://rubik.c
file://engine_data.c
file://scheduler.c
file://engine_debug.c
file://sdp.c
file://dla_engine_internal.h
file://opendla_initial.h
file://dla_interface.h
file://opendla_small.h
file://common.h
file://dla_sched.h
file://dla_debug.h
file://dla_engine.h
file://engine_debug.h
file://nvdla_linux.h
file://opendla.h
"
inherit module
S = "${WORKDIR}"

The inherit of module.bbclass will automatically name module packages with

@VVViy 仔细检查了,还是这个错误。
make: *** No rule to make target 'modules_install'. Stop.
我用的2018.2,但是还是可以借鉴下,看Xilinx UG1144上写的,需要添加do install()...,但是不知道针对咱们这个opendla这样的用法该怎么写才好。能把您的opendla.bb写的全部内容分享下吗。谢谢

@honorpeter
Copy link

SUMMARY = "Recipe for build an external opendla Linux kernel module"
SECTION = "PETALINUX/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
SRC_URI = "file://Makefile
file://cdp.c
file://bdma.c
file://cache.c
file://engine_isr.c
file://common.c
file://nvdla_core_callbacks.c
file://pdp.c
file://conv.c
file://engine.c
file://nvdla_gem.c
file://rubik.c
file://engine_data.c
file://scheduler.c
file://engine_debug.c
file://sdp.c
file://dla_engine_internal.h
file://opendla_initial.h
file://dla_interface.h
file://opendla_small.h
file://common.h
file://dla_sched.h
file://dla_debug.h
file://dla_engine.h
file://engine_debug.h
file://nvdla_linux.h
file://opendla.h
"
inherit module
S = "${WORKDIR}"

@VVViy
Copy link
Owner Author

VVViy commented Feb 18, 2019

@peterzh2018
如果你po出的内容和你.bb文件里的内容一致,那确实是错了,记得按照bitbake的要求,SRC_URI字符串实际上是一行,多行表示要在每行后面加分行符“\”,如下

SRC_URI = "file://Makefile
file://nvdla_core_callbacks.c
file://nvdla_gem.c
file://scheduler.c
file://engine.c
file://bdma.c
file://conv.c
file://sdp.c
file://cdp.c
file://pdp.c
file://rubik.c
file://cache.c
file://common.c
file://engine_data.c
file://engine_isr.c
file://engine_debug.c
file://common.h
file://dla_debug.h
file://dla_engine.h
file://dla_engine_internal.h
file://dla_err.h
file://dla_interface.h
file://dla_sched.h
file://engine_debug.h
file://nvdla_interface.h
file://nvdla_linux.h
file://opendla.h
file://opendla_initial.h
file://opendla_small.h
file://nvdla_ioctl.h
file://COPYING
"

@honorpeter
Copy link

@peterzh2018
如果你po出的内容和你.bb文件里的内容一致,那确实是错了,记得按照bitbake的要求,SRC_URI字符串实际上是一行,多行表示要在每行后面加分行符“\”,如下

SRC_URI = "file://Makefile
file://nvdla_core_callbacks.c
file://nvdla_gem.c
file://scheduler.c
file://engine.c
file://bdma.c
file://conv.c
file://sdp.c
file://cdp.c
file://pdp.c
file://rubik.c
file://cache.c
file://common.c
file://engine_data.c
file://engine_isr.c
file://engine_debug.c
file://common.h
file://dla_debug.h
file://dla_engine.h
file://dla_engine_internal.h
file://dla_err.h
file://dla_interface.h
file://dla_sched.h
file://engine_debug.h
file://nvdla_interface.h
file://nvdla_linux.h
file://opendla.h
file://opendla_initial.h
file://opendla_small.h
file://nvdla_ioctl.h
file://COPYING
"
不好意思复制贴错了,我是有斜杠的。
SUMMARY = "Recipe for build an external opendla Linux kernel module"
SECTION = "PETALINUX/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
SRC_URI = "file://Makefile
file://cdp
file://bdma.c
file://cache.c
file://engine_isr.c
file://common.c
file://nvdla_core_callbacks.c
file://pdp.c
file://conv.c
file://engine.c
file://nvdla_gem.c
file://rubik.c
file://engine_data.c
file://scheduler.c
file://engine_debug.c
file://sdp.c
file://dla_engine_internal.h
file://opendla_initial.h
file://dla_interface.h
file://opendla_small.h
file://common.h
file://dla_sched.h
file://dla_debug.h
file://dla_engine.h
file://engine_debug.h
file://nvdla_linux.h
file://opendla.h
"
inherit module
S = "${WORKDIR}"
这没错吧?用不用写do install();按UG1144上是需要写的呀。是不是因为没写造成的,您的.bb能全部贴出来我看下吗,谢谢

@honorpeter
Copy link

@peterzh2018
如果你po出的内容和你.bb文件里的内容一致,那确实是错了,记得按照bitbake的要求,SRC_URI字符串实际上是一行,多行表示要在每行后面加分行符“\”,如下

SRC_URI = "file://Makefile
file://nvdla_core_callbacks.c
file://nvdla_gem.c
file://scheduler.c
file://engine.c
file://bdma.c
file://conv.c
file://sdp.c
file://cdp.c
file://pdp.c
file://rubik.c
file://cache.c
file://common.c
file://engine_data.c
file://engine_isr.c
file://engine_debug.c
file://common.h
file://dla_debug.h
file://dla_engine.h
file://dla_engine_internal.h
file://dla_err.h
file://dla_interface.h
file://dla_sched.h
file://engine_debug.h
file://nvdla_interface.h
file://nvdla_linux.h
file://opendla.h
file://opendla_initial.h
file://opendla_small.h
file://nvdla_ioctl.h
file://COPYING
"
贴出来就不显示斜杠了,您贴的那个也是。

@VVViy
Copy link
Owner Author

VVViy commented Feb 18, 2019

哦,忘了转义字符这茬了,下面是我的完整opendla.bb内容,你可以核实一下,UG1144我看时好像没加过命令类的处理脚本,可能2018版有变化吧。

SUMMARY = "Recipe for  build an external opendla Linux kernel module"
SECTION = "PETALINUX/modules"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"

inherit module

SRC_URI = "file://Makefile \
           file://nvdla_core_callbacks.c \
		   file://nvdla_gem.c \
		   file://scheduler.c \
		   file://engine.c \
		   file://bdma.c \
		   file://conv.c \
		   file://sdp.c \
		   file://cdp.c \
		   file://pdp.c \
		   file://rubik.c \
	   	   file://cache.c \
	   	   file://common.c \
	   	   file://engine_data.c \
		   file://engine_isr.c \
	   	   file://engine_debug.c \
	   	   file://common.h \
	   	   file://dla_debug.h \
	   	   file://dla_engine.h \
	   	   file://dla_engine_internal.h \
	   	   file://dla_err.h \
	   	   file://dla_interface.h \
	   	   file://dla_sched.h \
	   	   file://engine_debug.h \
	   	   file://nvdla_interface.h \
	   	   file://nvdla_linux.h \
	   	   file://opendla.h \
	   	   file://opendla_initial.h \
	   	   file://opendla_small.h \
	   	   file://nvdla_ioctl.h \
	       file://COPYING \
          "

S = "${WORKDIR}"

# The inherit of module.bbclass will automatically name module packages with
# "kernel-module-" prefix as required by the oe-core build environment.

@dovanhuong
Copy link

when you completed build libjpeg, the output file is libjpeg.a you should replace new file in "external" folder, remove the previous one, it can works

@sunny-yellow
Copy link

when you completed build libjpeg, the output file is libjpeg.a you should replace new file in "external" folder, remove the previous one, it can works

Thank you, I try it. Sould I need to re-build it with aarch-linux-gnu-gcc?

@dovanhuong
Copy link

ah no need, this is independent, you just build inside umd is okay

@sunny-yellow
Copy link

ah no need, this is independent, you just build inside umd is okay

How to build inside umd?

@dovanhuong
Copy link

ah, you can place source "libjpeg" inside "external" folder and build inside as normal, then follow the steps I said before~~

@sunny-yellow
Copy link

ah, you can place source "libjpeg" inside "external" folder and build inside as normal, then follow the steps I said before~~

The source "libjpeg" is libjpeg.a?

@dovanhuong
Copy link

dovanhuong commented Aug 11, 2021

ah no, you should download opensource of "libjpeg" and compile it,https://www.ijg.org/files/jpegsrc.v9d.tar.gz

@sunny-yellow
Copy link

ah no, you should download opensource of "libjpeg" and compile it,https://www.ijg.org/files/jpegsrc.v9d.tar.gz

Thank you, I will try.

@sunny-yellow
Copy link

ah no, you should download opensource of "libjpeg" and compile it,https://www.ijg.org/files/jpegsrc.v9d.tar.gz

Thank you, I will try.

I an so sorry to bother you again, can you explain the difference or operations of the re-build and complie for the libjpeg.

@dovanhuong
Copy link

well, 1st step, you should remove "libjpeg.a" inside "external" folder. 2nd step, build libjpeg from source I sent you before. 3rd take output file "libjpeg.a" place into "external" folder.
Then, build "umd" again, it can works!

@sunny-yellow
Copy link

well, 1st step, you should remove "libjpeg.a" inside "external" folder. 2nd step, build libjpeg from source I sent you before. 3rd take output file "libjpeg.a" place into "external" folder.
Then, build "umd" again, it can works!

Why I should put the source libjpeg that downloaded from website in the umd/external and build it in external?

@dovanhuong
Copy link

well, you don't need to put inside "umd/external" folder, I just recommend to you that place to keep source, you can place wherever you like~

@sunny-yellow
Copy link

well, you don't need to put inside "umd/external" folder, I just recommend to you that place to keep source, you can place wherever you like~

OK, thank you.

@gxk17
Copy link

gxk17 commented Aug 13, 2021

@dovanhuong
9 is okay

hello, I rebuilt libjpeg.a using jpegsrc.v9d, thus I can make "umd" successfully. But when I run ./nvdla_runtime, it reports something wrong about jpeg:
JPEG parameter struct mismatch: library thinks size is 664, caller expects 656
Should I change "jpeglib.h" or any other file in "umd/externel/include"?
Thanks a lot!

@sunny-yellow
Copy link

@dovanhuong
9 is okay

hello, I rebuilt libjpeg.a using jpegsrc.v9d, thus I can make "umd" successfully. But when I run ./nvdla_runtime, it reports something wrong about jpeg:
JPEG parameter struct mismatch: library thinks size is 664, caller expects 656
Should I change "jpeglib.h" or any other file in "umd/externel/include"?
Thanks a lot!

I also meet this problem.

@dovanhuong
Copy link

well, send me the log error

@sunny-yellow
Copy link

well, send me the log error

Usage: ./nvdla_runtime [-options] --loadable <loadable_file>
where options include:
-h print this help message
-s launch test in server mode
--image input jpg/pgm file
--normalize normalize value for input image
--mean comma separated mean value for input image
--rawdump dump raw dimg data
root@nvdla_p3:/media/card/umd/out/apps/runtime/nvdla_runtime# ./nvdla_runtime --loadable /media/card/umd/resnet18-cifar10-caffe/loadables/fast-math.nvdla --image /media/card/umd/resnet18-cifar10-caffe/Image/175_4.jpg --rawdump
creating new runtime context...
Emulator starting
JPEG parameter struct mismatch: library thinks size is 664, caller expects 656
root@nvdla_p3:/media/card/umd/out/apps/runtime/nvdla_runtime#

@dovanhuong
Copy link

well, try to re-compile with another version of libjpeg, the lower version could be better

@sunny-yellow
Copy link

well, try to re-compile with another version of libjpeg, the lower version could be better

Thank you.

@gxk17
Copy link

gxk17 commented Aug 13, 2021

@dovanhuong
well, try to re-compile with another version of libjpeg, the lower version could be better

Thanks, I used jpeg v6b and fixed this problem. But I got a new problem while running "pdp_L0_0_small_fbuf", here is a part of the error log:

[ 222.072241] Enter: dla_program_operation
[ 222.076156] Program PDP operation index 0 ROI 0 Group[0]
[ 222.081460] group id 0 rdma id 0
[ 222.084680] Invalid dst_data.mem_type: 2048
[ 222.088855] Exit: dla_program_operation status=-3
[ 222.093549] Exit: dla_submit_operation

it seems that "mem_type" should be 0 (defined as DLA_MEM_MC in dla_interface.h)
Are you using borard with MPSoC?
Thanks!

@sunny-yellow
Copy link

@dovanhuong
well, try to re-compile with another version of libjpeg, the lower version could be better

Thanks, I used jpeg v6b and fixed this problem. But I got a new problem while running "pdp_L0_0_small_fbuf", here is a part of the error log:

[ 222.072241] Enter: dla_program_operation
[ 222.076156] Program PDP operation index 0 ROI 0 Group[0]
[ 222.081460] group id 0 rdma id 0
[ 222.084680] Invalid dst_data.mem_type: 2048
[ 222.088855] Exit: dla_program_operation status=-3
[ 222.093549] Exit: dla_submit_operation

it seems that "mem_type" should be 0 (defined as DLA_MEM_MC in dla_interface.h)
Are you using borard with MPSoC?
Thanks!

May I have your e-mail? I want to communicate with you something.

@gxk17
Copy link

gxk17 commented Aug 13, 2021

@dovanhuong
well, try to re-compile with another version of libjpeg, the lower version could be better

Thanks, I used jpeg v6b and fixed this problem. But I got a new problem while running "pdp_L0_0_small_fbuf", here is a part of the error log:
[ 222.072241] Enter: dla_program_operation
[ 222.076156] Program PDP operation index 0 ROI 0 Group[0]
[ 222.081460] group id 0 rdma id 0
[ 222.084680] Invalid dst_data.mem_type: 2048
[ 222.088855] Exit: dla_program_operation status=-3
[ 222.093549] Exit: dla_submit_operation
it seems that "mem_type" should be 0 (defined as DLA_MEM_MC in dla_interface.h)
Are you using borard with MPSoC?
Thanks!

May I have your e-mail? I want to communicate with you something.

sure,[email protected]

@dovanhuong
Copy link

well, my email: [email protected] Next week, I'll take a look on your issue ^^

@tongjiaxuan666
Copy link

题主您好,我在ZC706板子移植nvdla,芯片是ZYNQ7000,在移植KMD后 insmod后 出现了
vmap allocation for size 268439552 failed : use vmalloc= to increase size的错误,请问DMA预留的空间与vmalloc有必然的联系嘛。
在增加了vmalloc重新insmod后又出现了failed to register drm deviece的错误。请问应该从什么角度修改呢。

@sunny-yellow
Copy link

sunny-yellow commented Dec 21, 2021 via email

@tongjiaxuan666
Copy link

@sunny-yellow
我在用Tengine运行分类错的时候LeiWang1999/ZYNQ-NVDLA#7 (comment)
遇到和你同样的问题,请问你当时是怎么解决的呢?可以留一个联系方式方便沟通嘛?email或者QQ或者微信?

@wei8171023
Copy link

感谢博主的分享,我想问您一个问题!就是如何在vivado BD中查看DDR的有效地址呢?谢谢!

@VVViy
Copy link
Owner Author

VVViy commented Sep 14, 2022

感谢博主的分享,我想问您一个问题!就是如何在vivado BD中查看DDR的有效地址呢?谢谢!

我记得在BD里双击“zynq” IP,在弹出界面中是能看到和设置DDR地址的。

@wei8171023
Copy link

@VVViy

感谢博主的分享,我想问您一个问题!就是如何在vivado BD中查看DDR的有效地址呢?谢谢!

我记得在BD里双击“zynq” IP,在弹出界面中是能看到和设置DDR地址的。

嗯嗯,晓得了!还有个问题,您使用的ZCU102的内存是多大的呢?预留内存必须是0x40000000地址开始吗?我的是4GB内存,换成其他大点的起始地址的话在跑runtime就报SERROR的错误。请问您知道是为什么吗?谢谢!

@VVViy
Copy link
Owner Author

VVViy commented Sep 15, 2022

@VVViy

感谢博主的分享,我想问您一个问题!就是如何在vivado BD中查看DDR的有效地址呢?谢谢!

我记得在BD里双击“zynq” IP,在弹出界面中是能看到和设置DDR地址的。

嗯嗯,晓得了!还有个问题,您使用的ZCU102的内存是多大的呢?预留内存必须是0x40000000地址开始吗?我的是4GB内存,换成其他大点的起始地址的话在跑runtime就报SERROR的错误。请问您知道是为什么吗?谢谢!

zcu102好像也是4G,预留地址是指DMA的那个?要查一下那个DMA内存声明函数的定义,然后根据DDR有效地址计算一下,细节时间太久不记得了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests