13
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
+ set -e
16
17
17
18
GIT_ROOT=$( readlink -f ./$( git rev-parse --show-cdup) )
18
19
@@ -26,6 +27,21 @@ print_error() {
26
27
echo -e " ${RED} ERROR${NOCOLOR} :" $*
27
28
}
28
29
30
+ get_host_gpu () {
31
+ if ! command -v nvidia-smi > /dev/null; then
32
+ print_error Y " Could not find any GPU drivers on host. Defaulting build to target dGPU/CPU stack."
33
+ echo -n " dgpu"
34
+ elif nvidia-smi 2> /dev/null | grep nvgpu -q; then
35
+ echo -n " igpu"
36
+ else
37
+ echo -n " dgpu"
38
+ fi
39
+ }
40
+
41
+ get_host_arch () {
42
+ echo -n " $( uname -m) "
43
+ }
44
+
29
45
if [ ! -d $GIT_ROOT /build/object_detection_torch ]; then
30
46
print_error " Please build the Object Detection Torch application first with the following command:"
31
47
print_error " ./dev_container build_and_run object_detection_torch"
@@ -37,11 +53,18 @@ echo Creating application directory $APP_PATH...
37
53
mkdir -p $APP_PATH
38
54
echo Copying application files to $APP_PATH ...
39
55
cp -f $GIT_ROOT /build/object_detection_torch/applications/object_detection_torch/object_detection_torch $APP_PATH
40
- cp -f $GIT_ROOT /build/object_detection_torch/applications/object_detection_torch/object_detection_torch.yaml $APP_PATH
56
+
57
+ PLATFORM=x64-workstation
58
+ GPU=$( get_host_gpu)
59
+ if [ $( get_host_arch) == " aarch64" ]; then
60
+ PLATFORM=igx-orin-devkit
61
+ fi
41
62
42
63
echo -e " done\n"
43
- echo -e Use the following commands to package and run the Object Detection Torch application:\n
44
- echo -e " Package the application:\n"
45
- echo -e " ${YELLOW} holoscan package -c $APP_PATH /object_detection_torch.yaml --platform x64-workstation -t holohub-object-detection-torch $APP_PATH /object_detection_torch --include onnx holoviz torch${NOCOLOR} "
46
- echo -e " Run the application:\n"
64
+ echo -e Use the following commands to package and run the Object Detection Torch application:
65
+ echo -e " Package the application:"
66
+ echo -e " ${YELLOW} holoscan package -c $APP_PATH /object_detection_torch.yaml --platform [igx-orin-devkit | jetson-agx-orin-devkit | sbsa, x64-workstation] --platform-config [igpu | dgpu] -t holohub-object-detection-torch $APP_PATH /object_detection_torch --include onnx holoviz torch${NOCOLOR} "
67
+ echo -e " \nFor example:"
68
+ echo -e " ${YELLOW} holoscan package -c $APP_PATH /object_detection_torch.yaml --platform ${PLATFORM} --platform-config ${GPU} -t holohub-object-detection-torch $APP_PATH /object_detection_torch --include onnx holoviz torch${NOCOLOR} "
69
+ echo -e " \nRun the application:"
47
70
echo -e " ${YELLOW} holoscan run -r \$ (docker images | grep " holohub-object-detection-torch" | awk '{print \$ 1\" :\"\$ 2}') -i $GIT_ROOT /data/object_detection_torch${NOCOLOR} "
0 commit comments