forked from OE4T/meta-tegra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copying latest changes from PR OE4T#799
- Loading branch information
Showing
5 changed files
with
193 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
recipes-devtools/gie/tensorrt-samples/0001-Makefile-fix-cross-compilation-issues.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
From f196aef19ab533c5aae1195698c1d27c3ffc43bc Mon Sep 17 00:00:00 2001 | ||
From: Ilies CHERGUI <ilies.chergui@gmail.com> | ||
Date: Tue, 21 Sep 2021 23:12:52 +0100 | ||
Subject: [PATCH] Makefile: fix cross compilation issues | ||
|
||
Signed-off-by: Ilies CHERGUI <ilies.chergui@gmail.com> | ||
--- | ||
Makefile.config | 29 +++++++++++++++++++---------- | ||
1 file changed, 19 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/Makefile.config b/Makefile.config | ||
index 48c1a8d..70db6aa 100644 | ||
--- a/Makefile.config | ||
+++ b/Makefile.config | ||
@@ -5,6 +5,7 @@ DLSW_TRIPLE ?= x86_64-linux-gnu | ||
SAFE_PDK ?= 0 | ||
CPP_STANDARD?=14 | ||
TARGET ?= $(shell uname -m) | ||
+BUILD_TYPE ?= release | ||
|
||
ifeq ($(CUDA_INSTALL_DIR),) | ||
CUDA_INSTALL_DIR ?= /usr/local/cuda | ||
@@ -34,11 +35,11 @@ CUDNN_LIBDIR = lib64 | ||
ifeq ($(TARGET), aarch64) | ||
ifeq ($(shell uname -m), aarch64) | ||
CUDA_LIBDIR = lib64 | ||
- CC = g++ | ||
+ CXX ?= g++ | ||
else | ||
- CC = aarch64-linux-gnu-g++ | ||
+ CXX ?= aarch64-linux-gnu-g++ | ||
endif | ||
- CUCC = $(CUDA_INSTALL_DIR)/bin/nvcc -m64 -ccbin $(CC) | ||
+ CUCC = $(CUDA_INSTALL_DIR)/bin/nvcc -m64 -ccbin $(CXX) | ||
else ifeq ($(TARGET), x86_64) | ||
CUDA_LIBDIR = lib64 | ||
CC = g++ | ||
@@ -54,7 +55,7 @@ else ######## | ||
$(error Auto-detection of platform failed. Please specify one of the following arguments to make: TARGET=[aarch64|x86_64|qnx]) | ||
endif | ||
|
||
-CC_MAJOR_VER = $(shell $(CC) -dumpversion | sed -e "s/\..*//") | ||
+CC_MAJOR_VER = $(shell $(CXX) -dumpversion | sed -e "s/\..*//") | ||
ifeq (${CC_MAJOR_VER}, 4) | ||
CPP_STANDARD := 11 | ||
endif | ||
@@ -111,7 +112,7 @@ endef | ||
ifneq ($(USE_QCC),1) | ||
# Usage: $(call make-depend,source-file,object-file,depend-file) | ||
define make-depend | ||
- $(AT)$(CC) -MM -MF $3 -MP -MT $2 $(COMMON_FLAGS) $1 | ||
+ $(AT)$(CXX) -MM -MF $3 -MP -MT $2 $(COMMON_FLAGS) $1 | ||
endef | ||
# Usage: $(call make-cuda-depend,source-file,object-file,depend-file,flags) | ||
define make-cuda-depend | ||
@@ -305,7 +306,15 @@ CFLAGSD = $(COMMON_FLAGS) -g | ||
LFLAGS = $(COMMON_LD_FLAGS) | ||
LFLAGSD = $(COMMON_LD_FLAGS) | ||
|
||
-all: debug release | ||
+ifeq ($(BUILD_TYPE), release) | ||
+ all: release | ||
+else | ||
+ifeq ($(BUILD_TYPE), debug) | ||
+ all: debug | ||
+else | ||
+ all: debug release | ||
+endif | ||
+endif | ||
|
||
release : $(OUTDIR)/$(OUTNAME_RELEASE) | ||
|
||
@@ -321,25 +330,25 @@ test_release: | ||
|
||
$(OUTDIR)/$(OUTNAME_RELEASE) : $(OBJS) $(CUOBJS) | ||
$(ECHO) Linking: $@ | ||
- $(AT)$(CC) -o $@ $(LFLAGS) -Wl,--start-group $(LIBS) $^ -Wl,--end-group | ||
+ $(AT)$(CXX) -o $@ $(LFLAGS) -Wl,--start-group $(LIBS) $^ -Wl,--end-group | ||
|
||
$(OUTDIR)/$(OUTNAME_DEBUG) : $(DOBJS) $(CUDOBJS) | ||
$(ECHO) Linking: $@ | ||
- $(AT)$(CC) -o $@ $(LFLAGSD) -Wl,--start-group $(DLIBS) $^ -Wl,--end-group | ||
+ $(AT)$(CXX) -o $@ $(LFLAGSD) -Wl,--start-group $(DLIBS) $^ -Wl,--end-group | ||
|
||
$(OBJDIR)/%.o: %.cpp | ||
$(AT)if [ ! -d $(OBJDIR) ]; then mkdir -p $(OBJDIR); fi | ||
$(foreach XDIR,$(EXTRA_DIRECTORIES), if [ ! -d $(OBJDIR)/$(XDIR) ]; then mkdir -p $(OBJDIR)/$(XDIR); fi;) : | ||
$(call make-depend,$<,$@,$(subst .o,.d,$@)) | ||
$(ECHO) Compiling: $< | ||
- $(AT)$(CC) $(CFLAGS) -c -o $@ $< | ||
+ $(AT)$(CXX) $(CFLAGS) -c -o $@ $< | ||
|
||
$(DOBJDIR)/%.o: %.cpp | ||
$(AT)if [ ! -d $(DOBJDIR) ]; then mkdir -p $(DOBJDIR); fi | ||
$(foreach XDIR,$(EXTRA_DIRECTORIES), if [ ! -d $(OBJDIR)/$(XDIR) ]; then mkdir -p $(DOBJDIR)/$(XDIR); fi;) : | ||
$(call make-depend,$<,$@,$(subst .o,.d,$@)) | ||
$(ECHO) Compiling: $< | ||
- $(AT)$(CC) $(CFLAGSD) -c -o $@ $< | ||
+ $(AT)$(CXX) $(CFLAGSD) -c -o $@ $< | ||
|
||
######################################################################### CU | ||
$(OBJDIR)/%.o: %.cu | ||
-- | ||
2.17.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
DESCRIPTION = "NVIDIA TensorRT Samples for deep learning" | ||
LICENSE = "Proprietary" | ||
|
||
inherit l4t_deb_pkgfeed cuda | ||
|
||
HOMEPAGE = "http://developer.nvidia.com/tensorrt" | ||
|
||
PREFIX = "NoDLA-" | ||
PREFIX_tegra194 = "DLA-" | ||
|
||
L4T_DEB_GROUP = "tensorrt" | ||
|
||
SRC_SOC_DEBS = "\ | ||
libnvinfer-samples_${PV}+cuda10.2_all.deb;downloadfilename=${PREFIX}libnvinfer-samples_${PV}+cuda10.2_all.deb;name=samples;subdir=tensorrt \ | ||
" | ||
|
||
SRC_URI_append = " file://0001-Makefile-fix-cross-compilation-issues.patch" | ||
|
||
SRC_URI[samples.sha256sum] = "3a5162474cce7e191d78703b196bc8bdd5a6908d7537200194f1e80d72cf45a0" | ||
|
||
COMPATIBLE_MACHINE = "(tegra)" | ||
|
||
LIC_FILES_CHKSUM = "file://../../../share/doc/libnvinfer-samples/copyright;md5=713c2de2adb0f371a903b9fe20431bab" | ||
|
||
S = "${WORKDIR}/tensorrt/usr/src/tensorrt/samples" | ||
|
||
DEPENDS = "cuda-cudart cudnn tegra-libraries tensorrt-core tensorrt-plugins libglvnd" | ||
|
||
EXTRA_OEMAKE = ' \ | ||
CUDA_INSTALL_DIR="${STAGING_DIR_HOST}/usr/local/cuda-${CUDA_VERSION}" \ | ||
CUDNN_INSTALL_DIR="${STAGING_DIR_HOST}/usr/lib" \ | ||
TRT_LIB_DIR="${STAGING_DIR_HOST}/usr/lib" \ | ||
TARGET="${TARGET_ARCH}" BUILD_TYPE="release" \ | ||
' | ||
|
||
TARGET_CC_ARCH += "${LDFLAGS}" | ||
|
||
do_configure() { | ||
: | ||
} | ||
|
||
do_install() { | ||
install -d ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_algorithm_selector ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_char_rnn ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_dynamic_reshape ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_fasterRCNN ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_googlenet ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_int8 ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_int8_api ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_mlp ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_mnist ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_mnist_api ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_nmt ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_onnx_mnist ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_reformat_free_io ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_ssd ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_uff_faster_rcnn ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_uff_mask_rcnn ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_uff_mnist ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_uff_plugin_v2_ext ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/sample_uff_ssd ${D}${prefix}/src/tensorrt/bin | ||
install -m 0755 ${S}/../bin/trtexec ${D}${prefix}/src/tensorrt/bin | ||
|
||
install -d ${D}${prefix}/src/tensorrt/data | ||
cp -R --preserve=mode,timestamps ${S}/../data/* ${D}${prefix}/src/tensorrt/data | ||
} | ||
|
||
PACKAGES =+ "${PN}-trtexec" | ||
|
||
FILES_${PN} += "${prefix}/src/tensorrt/bin ${prefix}/src/tensorrt/data" | ||
FILES_${PN}-trtexec += "${prefix}/src/tensorrt/bin/trtexec" |