OE4T / meta-tegra

BSP layer for NVIDIA Jetson platforms, based on L4T
MIT License
420 stars 230 forks source link

Kirkstone l4t r32.7.x+backport fix glibc conflicts in containers #1638

Closed paroque28 closed 4 months ago

paroque28 commented 4 months ago

Backport of https://github.com/OE4T/meta-tegra/pull/1194

Since the csv is not an static file but rather automatically generated, we need to come up with some mechanism of replacing the lib path. That's why I added CONTAINER_CSV_LIB_PATH.

But I am open to any suggestion.

dwalkes commented 4 months ago

Thanks @paroque28. I still get the same error mentioned at https://github.com/Trellis-Logic/meta-tegra/pull/2#issuecomment-2239535926 when building for jetson nano with jetson-nano-2gb-devkit.

ERROR: tegra-container-passthrough-32.7.5-20240611161210-r0 do_fetch: Fetcher failure for URL: 'https://repo.download.nvidia.com/jetson/t210/pool/main/n/nvidia-l4t-multimedia/nvidia-l4t-multimedia_32.7.5-20240611161210_arm64.deb;subdir=tegra-container-passthrough-32.7.5-20240611161210;name=main'. Checksum mismatch!
File: '/home/dan/trellis/oe4t/tegra-demo-distro/build-r32.7.x/downloads/nvidia-l4t-multimedia_32.7.5-20240611161210_arm64.deb' has sha256 checksum 'faf67ea3283106cbe825078e6d22c5d75ebae2a28d5c480071ffcd000ca8042e' when '00aee7780face8a801d1bd612eaef2beaa01b72738acdbc3a83a3dd050830ced' was expected
If this change is expected (e.g. you have upgraded to a new version without updating the checksums) then you can use these lines within the recipe:
SRC_URI[main.sha256sum] = "faf67ea3283106cbe825078e6d22c5d75ebae2a28d5c480071ffcd000ca8042e"
Otherwise you should retry the download and/or check with upstream to determine if the file has become corrupted or otherwise unexpectedly modified.
ERROR: tegra-container-passthrough-32.7.5-20240611161210-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'https://repo.download.nvidia.com/jetson/t210/pool/main/n/nvidia-l4t-multimedia/nvidia-l4t-multimedia_32.7.5-20240611161210_arm64.deb;subdir=tegra-container-passthrough-32.7.5-20240611161210;name=main')
ERROR: Logfile of failure stored in: /home/dan/trellis/oe4t/tegra-demo-distro/build-r32.7.x/tmp/work/armv8a_tegra210-oe4t-linux/tegra-container-passthrough/32.7.5-20240611161210-r0/temp/log.do_fetch.2652919
ERROR: Task (/home/dan/trellis/oe4t/tegra-demo-distro/layers/meta-tegra/recipes-bsp/tegra-binaries/tegra-container-passthrough_32.7.5.bb:do_fetch) failed with exit code '1'

My build config is:

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-oe4t-linux"
MACHINE              = "jetson-nano-2gb-devkit"
DISTRO               = "tegrademo"
DISTRO_VERSION       = "4.0.20+snapshot-6bd3969d32730538608e680653e032e66958fe84"
TUNE_FEATURES        = "aarch64 armv8a crc"
TARGET_FPU           = ""
meta                 = "HEAD:6bd3969d32730538608e680653e032e66958fe84"
meta-tegra
contrib              = "kirkstone-l4t-r32.7.x+backport-fix-glibc-conflicts-in-containers:64594ba1d1192a31a2606c0ec8846b4136e8c812"
meta-oe
meta-python
meta-networking
meta-filesystems     = "kirkstone:6ff0748a4741517519a281985fc3cd95dadb633e"
meta-virtualization  = "kirkstone:ef76369f844f8b5afea416372172824987ad4fec"
meta-tegra-community = "HEAD:1cf7e5d8f1fa5b0d065f4f03ada43b9eedbb7d88"
meta-tegra-support
meta-demo-ci
meta-tegrademo       = "kirkstone-l4t-r32.7.x:3d8ff3b4e5d42a77a139ddb649f73775a8128e4d"

If I change the MACHINE to jetson-tx2-devkit I don't see this issue with bitbake tegra-container-passthrough, so it appears to be specific to nano. My guess is we need to specify different SRC_URI based on machine overrides.

madisongh commented 4 months ago

My guess is we need to specify different SRC_URI based on machine overrides.

Well, a different checksum anyway - the SRC_SOC_DEBS variable handles the SRC_URI differences for you. Check around the other recipes in recipes-bsp/tegra-binaries for how the per-SoC deb packages are handled there.

paroque28 commented 4 months ago

@dwalkes I've fixed the checksums for tegra210

dwalkes commented 4 months ago

Thanks @paroque28 I'll test on nano today.

Did you verify the tegra194 checksums are the same too by testing one of those builds?

paroque28 commented 4 months ago

@dwalkes no, but I just confirmed it works.

I got this warning though: WARNING: tegra-container-passthrough-32.7.5-20240611161504-r0 do_install: Unrecognized file type for container CSV: usr/lib/*.so*

Need to check what that is...

dwalkes commented 4 months ago

I noticed that with nano too

paroque28 commented 4 months ago

The reason for that warning is that in container-runtime-csv: CONTAINER_CSV_FILES gets assigned to this: CONTAINER_CSV_FILES ??= "${libdir}/*.so*" Because in the passthrough this variable is not assigned to anything

And the following code gets executed:

globbed = glob.glob(csvglob)
if globbed and globbed != [ csvglob ]:
    entries.update([entry[2:] for entry in globbed])
else:
    entries.update([csvglob[2:]])        

Being csvglob = "./usr/lib/*.so*"

The glob doesn't find anything in that path and the warning is showed.

A better error handling could be:

globbed = glob.glob(csvglob)
if globbed and globbed != [ csvglob ]:
    entries.update([entry[2:] for entry in globbed])
elif len(globbed) == 0:
    bb.warn("No results for container CSV glob {}".format(csvglob))
else:
    entries.update([csvglob[2:]])     

But the real question is, why no files match the glob? Do we really need to inherit from csv_runtime?

paroque28 commented 4 months ago

For now I'll set CONTAINER_CSV_FILES to ""

dwalkes commented 4 months ago

I'll test on nano today.

The project at https://github.com/cu-ecen-aeld/deepstream-nvdsanalytics-docker works on Nano with the changes in this branch. Thanks @paroque28 !