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
191 additions
and
38 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
100 changes: 100 additions & 0 deletions
100
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,100 @@ | ||
From 2fb0ba399055414cf23c32e5e38abaf064dbdc19 Mon Sep 17 00:00:00 2001 | ||
From: Bryan Cisneros <bcisneros@sighthound.com> | ||
Date: Sat, 25 Sep 2021 21:26:28 -0600 | ||
Subject: [PATCH] Makefile: fix cross compilation issues | ||
|
||
Signed-off-by: Bryan Cisneros <bcisneros@sighthound.com> | ||
--- | ||
Makefile.config | 27 ++++++++++++++++++--------- | ||
1 file changed, 18 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/Makefile.config b/Makefile.config | ||
index a2a5ca8..19fe755 100644 | ||
--- a/Makefile.config | ||
+++ b/Makefile.config | ||
@@ -4,6 +4,7 @@ CUBLAS_TRIPLE ?= x86_64-linux-gnu | ||
DLSW_TRIPLE ?= x86_64-linux-gnu | ||
SAFE_PDK ?= 0 | ||
TARGET ?= $(shell uname -m) | ||
+BUILD_TYPE ?= release | ||
|
||
ifeq ($(CUDA_INSTALL_DIR),) | ||
CUDA_INSTALL_DIR ?= /usr/local/cuda | ||
@@ -33,11 +34,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++ | ||
@@ -90,7 +91,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 | ||
@@ -265,7 +266,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) | ||
|
||
@@ -292,13 +301,13 @@ $(OUTDIR)/$(OUTNAME_DEBUG) : $(DOBJS) $(CUDOBJS) | ||
else | ||
$(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 | ||
# Copy every EXTRA_FILE of this sample to bin dir | ||
$(foreach EXTRA_FILE,$(EXTRA_FILES), cp -f $(EXTRA_FILE) $(OUTDIR)/$(EXTRA_FILE); ) | ||
|
||
$(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 | ||
endif | ||
|
||
$(OBJDIR)/%.o: %.cpp | ||
@@ -306,14 +315,14 @@ $(OBJDIR)/%.o: %.cpp | ||
$(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.33.0 | ||
|
||
|
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=ea60fab79a29c78a6958fc75552ffdc0" | ||
|
||
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" |