jetson-examples 0.1.7__py3-none-any.whl → 0.1.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jetson-examples
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Running Gen AI models and applications on NVIDIA Jetson devices with one-line command
5
5
  Author-email: luozhixin <zhixin.luo@seeed.cc>
6
6
  Project-URL: Homepage, https://github.com/Seeed-Projects/jetson-examples
@@ -62,7 +62,7 @@ Here are some examples that can be run:
62
62
  | ------------------------------------------------ | ------------------------ | --------------- | ---------- | --------------------------------------- |
63
63
  | 🆕 llama-factory | Finetune LLM | | 13.5GB | `reComputer run llama-factory` |
64
64
  | 🆕 [ComfyUI](/reComputer/scripts/comfyui/README.md) |Computer Vision | | 20GB | `reComputer run comfyui` |
65
- | 🆕 [Depth-Anything-V2](/reComputer/scripts/depth-anything-v2/README.md) |Computer Vision | | 15GB | `reComputer run depth-anything-v2` |
65
+ | [Depth-Anything-V2](/reComputer/scripts/depth-anything-v2/README.md) |Computer Vision | | 15GB | `reComputer run depth-anything-v2` |
66
66
  | [Depth-Anything](/reComputer/scripts/depth-anything/README.md) |Computer Vision | | 12.9GB | `reComputer run depth-anything` |
67
67
  | [Yolov10](/reComputer/scripts/yolov10/README.md) | Computer Vision | 7.2M | 5.74 GB | `reComputer run yolov10` |
68
68
  | Llama3 | Text (LLM) | 4.9GB | 10.5GB | `reComputer run llama3` |
@@ -74,9 +74,9 @@ Here are some examples that can be run:
74
74
  | [Nanodb](../reComputer/scripts/nanodb/readme.md) | Vector Database | 76GB | 7.0GB | `reComputer run nanodb` |
75
75
  | Whisper | Audio | 1.5GB | 6.0GB | `reComputer run whisper` |
76
76
  | [Yolov8-rail-inspection](/reComputer/scripts/yolov8-rail-inspection/readme.md) | Computer Vision | 6M | 13.8GB | `reComputer run yolov8-rail-inspection` |
77
- |🆕 [Ultralytics-yolo](/reComputer/scripts/ultralytics-yolo/README.md) | Computer Vision | | 15.4GB | `reComputer run ultralytics-yolo` |
78
- | 🆕 [TensorFlow MoveNet Thunder](/reComputer/scripts/MoveNet-Thunder/readme.md) |Computer Vision | | 7.7GB | `reComputer run MoveNet-Thunder` |
79
- | 🆕 [Parler-TTS mini: expresso](/reComputer/scripts/parler-tts/readme.md) | Audio | | 6.9GB | `reComputer run parler-tts` |
77
+ | [Ultralytics-yolo](/reComputer/scripts/ultralytics-yolo/README.md) | Computer Vision | | 15.4GB | `reComputer run ultralytics-yolo` |
78
+ | [TensorFlow MoveNet Thunder](/reComputer/scripts/MoveNet-Thunder/readme.md) |Computer Vision | | 7.7GB | `reComputer run MoveNet-Thunder` |
79
+ | [Parler-TTS mini: expresso](/reComputer/scripts/parler-tts/readme.md) | Audio | | 6.9GB | `reComputer run parler-tts` |
80
80
 
81
81
 
82
82
  > Note: You should have enough space to run example, like `LLaVA`, at least `27.4GB` totally
@@ -106,9 +106,9 @@ For any questions or further information, feel free to reach out via the GitHub
106
106
 
107
107
  ## TODO List
108
108
 
109
- - [x] detect host environment and install what we need
110
- - [x] all type jetson support checking list
111
- - [x] try jetpack 6.0
109
+ - [ ] detect host environment and install what we need
110
+ - [ ] all type jetson support checking list
111
+ - [ ] try jetpack 6.0
112
112
  - [ ] check disk space enough or not before run
113
113
  - [ ] allow to setting some configs, such as `BASE_PATH`
114
114
  - [ ] support jetson-containers update
@@ -4,6 +4,7 @@ reComputer/scripts/check.sh,sha256=cUMwAjHpgJoaD5a8gTLJG7QWjF9CyKPgQ-ewRNK3FD8,1
4
4
  reComputer/scripts/clean.sh,sha256=TlGas1IKqSX7MEkZe4VvCQJgjDNEvfQyuAeXtKraNMA,898
5
5
  reComputer/scripts/run.sh,sha256=aKxkcj16zemZWf5ut6gHtTsgufFm4IK8GPd2b6MBQIQ,1127
6
6
  reComputer/scripts/update.sh,sha256=9Pw9-laO8NU2-4t4UisjFEwHPY5-ZAIoDi3AqWBzBbs,900
7
+ reComputer/scripts/utils.sh,sha256=Saowhj8BbwWtuYS7Q-3IZ4CDb5V_EbeM0upby2ryWNM,6794
7
8
  reComputer/scripts/MoveNet-Lightning/clean.sh,sha256=B-CJEj8KQPd5evJjl9XDpMgQRn6-hcaxB6oEUfVozrs,124
8
9
  reComputer/scripts/MoveNet-Lightning/getVersion.sh,sha256=pFaf2Uej2AhqeXkm-EJ5Zc9vqQpQwKUaK2CxKUVOfMY,1648
9
10
  reComputer/scripts/MoveNet-Lightning/init.sh,sha256=A_lpAHeXzm2POhyTBvzl3Zm7CQ9GsfyzmGwLuqOyBsA,61
@@ -25,10 +26,10 @@ reComputer/scripts/audiocraft/init.sh,sha256=ktAKm4XFtJYntnSR-oAK4G5OhCSSoKw511m
25
26
  reComputer/scripts/audiocraft/run.sh,sha256=b0kjEeZnA5diQw6vjyrkOX-Svs5XVKGt0ABbWtZsZEs,160
26
27
  reComputer/scripts/comfyui/LICENSE,sha256=feSgondqafLDgk7Dp9gnVBE5Y9K5X9mal_DGYKALzXQ,1073
27
28
  reComputer/scripts/comfyui/README.md,sha256=WVuDKU4ncER6-EdWssBHDuFcEJJh0f0Q2tjyl0JUaak,7868
28
- reComputer/scripts/comfyui/clean.sh,sha256=GIhFqZlwEKR5UbGjIRkRX1u0cwsHRz1I0fY-MHdI-b0,161
29
- reComputer/scripts/comfyui/config.yaml,sha256=GY34mu3ys0UG01U54_bfL0JmovHMLSQDbok-AUoTj1w,672
30
- reComputer/scripts/comfyui/init.sh,sha256=7iMkOF0bs2qBCplIxAJgejx-dBYPwHCoPM9S8EFq9Ek,6123
31
- reComputer/scripts/comfyui/run.sh,sha256=QInaOlIoq8ZqkzptQTASvmFk-Fig8fYs5PdbbxwUpFw,869
29
+ reComputer/scripts/comfyui/clean.sh,sha256=mzTwIlHg8FJBIe0Q0lr1oGcLAwFV40EzD2EzoJvifrk,205
30
+ reComputer/scripts/comfyui/config.yaml,sha256=ZMEclnn_wJ71Xw0oYVwUURhRz3CG4pvi5QBmmgJEmSU,636
31
+ reComputer/scripts/comfyui/init.sh,sha256=owGwu9aVdsosjBzrPmZOQtunaLOtCjjxzkr7pb_zUoQ,226
32
+ reComputer/scripts/comfyui/run.sh,sha256=OveMB_K3DCne4UzIM7_CrigjaE_vlOmhcHOxF8jACN0,911
32
33
  reComputer/scripts/depth-anything/Dockerfile,sha256=gJ2Q1g2E06_z4hy9C-m1bA4X2IMqRWuo42izFfQ_E5Y,279
33
34
  reComputer/scripts/depth-anything/LICENSE,sha256=feSgondqafLDgk7Dp9gnVBE5Y9K5X9mal_DGYKALzXQ,1073
34
35
  reComputer/scripts/depth-anything/README.md,sha256=FeSMWdOFv2SeWA4x_abPzy7eK3AbaUhCcsHuNQzS0dk,4918
@@ -53,7 +54,8 @@ reComputer/scripts/llama-factory/assets/llama-factory-Jetson.png,sha256=bUoDJWCi
53
54
  reComputer/scripts/llama-factory/assets/training.gif,sha256=UerCprNflf1Jp9Cx7E9FANrH6E5GIMvo0K6SLjUIKx4,13806069
54
55
  reComputer/scripts/llama-factory/assets/webui.png,sha256=RXaMyX3cIqZVoO27z5kn0rmbfEapdMuWN2JmPZlJlB0,419226
55
56
  reComputer/scripts/llama3/clean.sh,sha256=lSFxp-uGD8vtzXMcZz8Id_CweQZfQbglrce7_sgMXcc,658
56
- reComputer/scripts/llama3/init.sh,sha256=ktAKm4XFtJYntnSR-oAK4G5OhCSSoKw511mR9qk6xGw,428
57
+ reComputer/scripts/llama3/config.yaml,sha256=pJTev2aiqRhhCqJ87wzlCpJgKRFLl8AZfx3uKiyWWCk,646
58
+ reComputer/scripts/llama3/init.sh,sha256=T0IuhQo4oPM7BFUgcd95MXvK0Hwrig8djdm5akjijkc,569
57
59
  reComputer/scripts/llama3/run.sh,sha256=IkHvMwh_U8fp7AH2qWFUMWywHZDbZKHlp8ODzfHgqBQ,328
58
60
  reComputer/scripts/llava/clean.sh,sha256=7t2SIxj6_elOpHxtTjl9ofnU5d9Ir2r5eyNAj6lAI68,70
59
61
  reComputer/scripts/llava/init.sh,sha256=ktAKm4XFtJYntnSR-oAK4G5OhCSSoKw511mR9qk6xGw,428
@@ -68,7 +70,8 @@ reComputer/scripts/nanodb/run.sh,sha256=YHuLNtWcmx82QBnTa4vGzhFjNM9MJUbyi_XYbMG6
68
70
  reComputer/scripts/nanoowl/init.sh,sha256=ktAKm4XFtJYntnSR-oAK4G5OhCSSoKw511mR9qk6xGw,428
69
71
  reComputer/scripts/nanoowl/run.sh,sha256=jXG3JoE1MQOb6UjOwf0SNmbX5MsAA5weMEQLihspI0c,264
70
72
  reComputer/scripts/ollama/clean.sh,sha256=lSFxp-uGD8vtzXMcZz8Id_CweQZfQbglrce7_sgMXcc,658
71
- reComputer/scripts/ollama/init.sh,sha256=ktAKm4XFtJYntnSR-oAK4G5OhCSSoKw511mR9qk6xGw,428
73
+ reComputer/scripts/ollama/config.yaml,sha256=pJTev2aiqRhhCqJ87wzlCpJgKRFLl8AZfx3uKiyWWCk,646
74
+ reComputer/scripts/ollama/init.sh,sha256=T0IuhQo4oPM7BFUgcd95MXvK0Hwrig8djdm5akjijkc,569
72
75
  reComputer/scripts/ollama/run.sh,sha256=JQNDtIlpuGNJm4XuUC_Sy4qPmSOfeAsd8VOrxAvyavU,246
73
76
  reComputer/scripts/parler-tts/clean.sh,sha256=PCDbCFuZDL9UEoZ3pQ-Q80xxvcMhAlxvmjDqh15JE1E,122
74
77
  reComputer/scripts/parler-tts/getVersion.sh,sha256=pFaf2Uej2AhqeXkm-EJ5Zc9vqQpQwKUaK2CxKUVOfMY,1648
@@ -82,22 +85,25 @@ reComputer/scripts/text-generation-webui/run.sh,sha256=mRlWxZTArGXoyyeHbgZvPbVKT
82
85
  reComputer/scripts/ultralytics-yolo/LICENSE,sha256=feSgondqafLDgk7Dp9gnVBE5Y9K5X9mal_DGYKALzXQ,1073
83
86
  reComputer/scripts/ultralytics-yolo/README.md,sha256=InfR1206B9Qo9xPp7GdAmb2ZUdb9lrgHn0H_M1hBlGY,6085
84
87
  reComputer/scripts/ultralytics-yolo/clean.sh,sha256=51z_LiiS4XFPmE23t3Mi4P92UYEidefrLNGhBVENqZ0,186
85
- reComputer/scripts/ultralytics-yolo/config.yaml,sha256=TMXvIo19H_38XDPK-3-l2pzRfxJzaxpFXc05bL8Zmbg,704
86
- reComputer/scripts/ultralytics-yolo/init.sh,sha256=im46dO6GV3aymBxpbWONMqqs3Z_i4qsoTQJkhsbs7i8,6402
87
- reComputer/scripts/ultralytics-yolo/run.sh,sha256=JcM1_34PC-tT71YdQe4jJ21APJugdLhET1XR2kH8O6I,779
88
+ reComputer/scripts/ultralytics-yolo/config.yaml,sha256=FhmaI16bv7G1IpXqhgnb8WV3Du9s1evGSm0Fzvw_TDU,646
89
+ reComputer/scripts/ultralytics-yolo/init.sh,sha256=Va_ESXeVYXmnz0PMqBXl9ysQL_SudOiUPDgHsrGLo0M,121
90
+ reComputer/scripts/ultralytics-yolo/run.sh,sha256=LRs8Kwkevcr0-B0ZePZ0XZdiaCn9RCA7YVscEMgAtTA,845
88
91
  reComputer/scripts/whisper/init.sh,sha256=ktAKm4XFtJYntnSR-oAK4G5OhCSSoKw511mR9qk6xGw,428
89
92
  reComputer/scripts/whisper/run.sh,sha256=UKiY7Ie5uyGrdvAob1XwPSlpdEL27HR5vcMtnVOrph4,146
90
93
  reComputer/scripts/yolov10/Dockerfile,sha256=G25SPvYE9yYpMi0nRWcqKXbXJNdomnPV4tIZUVkmhWw,466
91
94
  reComputer/scripts/yolov10/README.md,sha256=oMIr-1IBN0VZdovILqX-bLjfUT8cHQRGotqefTm0MVQ,3623
92
95
  reComputer/scripts/yolov10/clean.sh,sha256=ErryX-k5UNlOj3IoIxEs5j55e7hysO3rlo5KenN4QWE,106
93
- reComputer/scripts/yolov10/init.sh,sha256=juYjv4_djBF0T05G0o6gsmitv3jxQT7LU9SneETIAX8,1679
96
+ reComputer/scripts/yolov10/config.yaml,sha256=FhmaI16bv7G1IpXqhgnb8WV3Du9s1evGSm0Fzvw_TDU,646
97
+ reComputer/scripts/yolov10/init.sh,sha256=y3nEoCU1y8IEYjxsYFAWV1njyO_tG6owSYH6uDroM34,602
94
98
  reComputer/scripts/yolov10/run.sh,sha256=xPZ9pvoi_AyY9F4ujT-xGcockqeQOZzSC45J-6qyHwE,289
95
99
  reComputer/scripts/yolov10/assets/webui.png,sha256=gNOLP0ptxTcFk16zktRE5qEJ9aIkOmWeMBU08FeB9YM,2600779
100
+ reComputer/scripts/yolov8-rail-inspection/config.yaml,sha256=FhmaI16bv7G1IpXqhgnb8WV3Du9s1evGSm0Fzvw_TDU,646
101
+ reComputer/scripts/yolov8-rail-inspection/init.sh,sha256=8IqV1qC0LlklcWEdfUVMBAVm8abFIXUdsawg4uAbf9Q,122
96
102
  reComputer/scripts/yolov8-rail-inspection/readme.md,sha256=awuvn2sLDnr-U4Q5pTTyieJMYNy27NRQyFhiQyiUNFI,2008
97
103
  reComputer/scripts/yolov8-rail-inspection/run.sh,sha256=rTpjiwMgn6iA3IJ6QDFR9wkOMDVCQ-qgTbFo2YKiX-c,809
98
- jetson_examples-0.1.7.dist-info/LICENSE,sha256=ac_LOi8ChcJhymEfBulX98Y06wTI2IMcQnqCXZ5yay4,1066
99
- jetson_examples-0.1.7.dist-info/METADATA,sha256=e4uRXRlN197zwpa4_OsgnscBi2Go5M-B7_wZJuCsaHI,6748
100
- jetson_examples-0.1.7.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
101
- jetson_examples-0.1.7.dist-info/entry_points.txt,sha256=5-OdcBifoDjVXE9KjNoN6tQa8l_XSXhdbBEgL2hxeDM,58
102
- jetson_examples-0.1.7.dist-info/top_level.txt,sha256=SI-liiUOkoGwOJfMP7d7k63JKgdcbiEj6DEC8QIKI90,11
103
- jetson_examples-0.1.7.dist-info/RECORD,,
104
+ jetson_examples-0.1.9.dist-info/LICENSE,sha256=ac_LOi8ChcJhymEfBulX98Y06wTI2IMcQnqCXZ5yay4,1066
105
+ jetson_examples-0.1.9.dist-info/METADATA,sha256=u2fKkVi5YFt1NPl-ZUYU4N4tBeAOhHLXRm9UXKK5ZfM,6729
106
+ jetson_examples-0.1.9.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
107
+ jetson_examples-0.1.9.dist-info/entry_points.txt,sha256=5-OdcBifoDjVXE9KjNoN6tQa8l_XSXhdbBEgL2hxeDM,58
108
+ jetson_examples-0.1.9.dist-info/top_level.txt,sha256=SI-liiUOkoGwOJfMP7d7k63JKgdcbiEj6DEC8QIKI90,11
109
+ jetson_examples-0.1.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (73.0.1)
2
+ Generator: setuptools (74.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -4,4 +4,6 @@ IMAGE_NAME="yaohui1998/comfyui"
4
4
 
5
5
  sudo docker stop $CONTAINER_NAME
6
6
  sudo docker rm $CONTAINER_NAME
7
- sudo docker rmi $IMAGE_NAME
7
+ sudo docker rmi $IMAGE_NAME
8
+
9
+ sudo rm -r /home/$USER/reComputer/ComfyUI
@@ -1,14 +1,15 @@
1
- allowed_l4t_versions:
2
- - 35.3.1 # Add your version here
3
- required_disk_space: 30 # in GB
4
- min_mem_gb: 15
5
- min_swap_gb: 6
6
- nvidia_jetson_package: "nvidia-jetpack"
7
- packages:
8
- #- "ros-noetic-ros-base"
9
- #- "flask"
10
- docker:
11
- desired_daemon_json: |
1
+ # The tested JetPack versions.
2
+ ALLOWED_L4T_VERSIONS:
3
+ - 35.3.1
4
+ - 35.4.1
5
+ - 35.5.0
6
+ REQUIRED_DISK_SPACE: 30 # in GB
7
+ REQUIRED_MEM_SPACE: 15
8
+ PACKAGES:
9
+ - nvidia-jetpack
10
+ DOCKER:
11
+ ENABLE: true
12
+ DAEMON: |
12
13
  {
13
14
  "default-runtime": "nvidia",
14
15
  "runtimes": {
@@ -1,163 +1,9 @@
1
1
  #!/bin/bash
2
- #set color value
3
- RED=$(tput setaf 1)
4
- GREEN=$(tput setaf 2)
5
- YELLOW=$(tput setaf 3)
6
- BLUE=$(tput setaf 4)
7
- MAGENTA=$(tput setaf 5)
8
- CYAN=$(tput setaf 6)
9
- RESET=$(tput sgr0)
10
2
 
11
- echo "${CYAN}This script will install the necessary packages and configurations for running comfyui on a Jetson.${RESET}"
3
+ # check the runtime environment.
4
+ source $(dirname "$(realpath "$0")")/../utils.sh
5
+ check_base_env "$(dirname "$(realpath "$0")")/config.yaml"
12
6
 
13
- # Install yq for parsing YAML files
14
- sudo apt-get update
15
- sudo apt-get install -y jq
16
- # Read configuration
17
- CURRENT_DIR="comfyui"
18
- CONFIG_FILE="./jetson-examples/reComputer/scripts/${CURRENT_DIR}/config.yaml"
19
- ALLOWED_L4T_VERSIONS=$(yq -r '.allowed_l4t_versions[]' $CONFIG_FILE)
20
- ALLOWED_L4T_VERSIONS_ARRAY=($ALLOWED_L4T_VERSIONS)
21
- REQUIRED_DISK_SPACE=$(yq -r '.required_disk_space' $CONFIG_FILE)
22
- MIN_MEM_GB=$(yq -r '.min_mem_gb' $CONFIG_FILE)
23
- MIN_SWAP_GB=$(yq -r '.min_swap_gb' $CONFIG_FILE)
24
- NVIDIA_JETSON_PACKAGE=$(yq -r '.nvidia_jetson_package' $CONFIG_FILE)
25
- PACKAGES=$(yq -r '.packages[]' $CONFIG_FILE)
26
- DESIRED_DAEMON_JSON=$(yq -r '.docker.desired_daemon_json' $CONFIG_FILE)
27
- CURRENT_DISK_SPACE=$(df -BG --output=avail / | tail -1 | sed 's/[^0-9]*//g')
28
- MEM_GB=$(free -g | awk '/^Mem:/{print $2}')
29
- SWAP_GB=$(free -g | awk '/^Swap:/{print $2}')
30
-
31
- echo "${MAGENTA}Allowed L4T versions:${RESET} ${GREEN}$ALLOWED_L4T_VERSIONS ${RESET}"
32
- echo "${MAGENTA}Required disk space: ${GREEN}${REQUIRED_DISK_SPACE}G ${RESET}"
33
- echo "${MAGENTA}Minimum memory: ${GREEN}${MIN_MEM_GB}G ${RESET}"
34
- echo "${MAGENTA}Minimum swap: ${GREEN}${MIN_SWAP_GB}G ${RESET}"
35
- echo "${MAGENTA}NVIDIA Jetson package:${RESET} ${GREEN}$NVIDIA_JETSON_PACKAGE ${RESET}"
36
- echo "${MAGENTA}Additional packages: ${RESET} ${GREEN}$PACKAGES ${RESET}"
37
-
38
- # Check if NVIDIA Jetson package is installed
39
- if ! dpkg -l | grep -qw "$NVIDIA_JETSON_PACKAGE"; then
40
- echo "$NVIDIA_JETSON_PACKAGE is not installed. Installing $NVIDIA_JETSON_PACKAGE..."
41
- sudo apt-get install -y $NVIDIA_JETSON_PACKAGE
42
- else
43
- echo "$NVIDIA_JETSON_PACKAGE is installed: ${GREEN}OK!${RESET}"
44
- fi
45
-
46
- # Install additional packages
47
- for PACKAGE in $PACKAGES; do
48
- if ! dpkg -l | grep -qw "$PACKAGE"; then
49
- echo "$PACKAGE is not installed. Installing $PACKAGE..."
50
- sudo apt-get install -y $PACKAGE
51
- else
52
- echo "$PACKAGE is installed: ${GREEN}OK!${RESET}"
53
- fi
54
- done
55
-
56
- # Get system architecture
57
- ARCH=$(uname -i)
58
- if [ "$ARCH" = "aarch64" ]; then
59
- # Check for L4T version string
60
- L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)
61
-
62
- if [ -z "$L4T_VERSION_STRING" ]; then
63
- L4T_VERSION_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
64
- fi
65
-
66
- L4T_RELEASE=$(echo "$L4T_VERSION_STRING" | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
67
- L4T_REVISION=$(echo "$L4T_VERSION_STRING" | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
68
- L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
69
-
70
- elif [ "$ARCH" = "x86_64" ]; then
71
- echo "${RED}Unsupported architecture: $ARCH${RESET}"
72
- exit 1
73
- fi
74
-
75
-
76
- # Check L4T version
77
- if [[ " ${ALLOWED_L4T_VERSIONS_ARRAY[@]} " =~ " ${L4T_VERSION} " ]]; then
78
- echo "L4T VERSION ${GREEN}${L4T_VERSION}${RESET} is in the allowed: ${GREEN}OK!${RESET}"
79
- else
80
- echo "${RED}L4T VERSION ${GREEN}${L4T_VERSION}${RESET}${RED} is not in the allowed versions list.${RESET}"
81
- exit 1
82
- fi
83
-
84
- # Check disk space
85
- if [ "$CURRENT_DISK_SPACE" -lt "$REQUIRED_DISK_SPACE" ]; then
86
- echo "${RED}Insufficient disk space. Required: ${REQUIRED_DISK_SPACE}G, Available: ${CURRENT_DISK_SPACE}G. ${RESET}"
87
- exit 1
88
- else
89
- echo "Required ${GREEN}${REQUIRED_DISK_SPACE}${RESET} G disk space: ${GREEN}OK!${RESET}"
90
- fi
91
-
92
- # Check memory and swap space
93
- if [ "$MEM_GB" -lt "$MIN_MEM_GB" ]; then
94
- echo "${RED}Insufficient memory: $MEM_GB GB (minimum required: $MIN_MEM_GB GB).${RESET}"
95
- exit 1
96
- else
97
- echo "Required ${GREEN}$MIN_MEM_GB${RESET} G memory space: ${GREEN}OK!${RESET}"
98
- fi
99
-
100
- if [ "$SWAP_GB" -lt "$MIN_SWAP_GB" ]; then
101
- echo "${RED}Insufficient swap space: $SWAP_GB GB (minimum required: $MIN_SWAP_GB GB). ${RESET}"
102
- exit 1
103
- else
104
- echo "Required ${GREEN}$MIN_SWAP_GB${RESET} G swap space: ${GREEN}OK!${RESET}"
105
- fi
106
-
107
- # Check if Docker is installed
108
- if ! command -v docker &> /dev/null; then
109
- echo "${BLUE}Docker is not installed. Installing Docker...${RESET}"
110
-
111
- sudo apt-get install -y \
112
- apt-transport-https \
113
- ca-certificates \
114
- curl \
115
- software-properties-common
116
-
117
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
118
- sudo add-apt-repository \
119
- "deb [arch=arm64] https://download.docker.com/linux/ubuntu \
120
- $(lsb_release -cs) \
121
- stable"
122
-
123
- sudo apt-get update
124
- sudo apt-get install -y docker-ce
125
- sudo systemctl enable docker
126
- sudo systemctl start docker
127
- sudo usermod -aG docker $USER
128
- sudo systemctl restart docker
129
- newgrp docker
130
-
131
- echo "Docker has been installed and configured."
132
- fi
133
-
134
- # Check if the current user has permissions to use Docker
135
- if ! docker info &> /dev/null; then
136
- echo "The current user does not have permissions to use Docker. Adding permissions..."
137
- sudo usermod -aG docker $USER
138
- sudo systemctl restart docker
139
- newgrp docker
140
- echo "${BLUE}Permissions added. Please log out and log back in for the changes to take effect.${RESET}"
141
- else
142
- echo "${GREEN}Docker is installed and the current user has permissions to use it.${RESET}"
143
- fi
144
-
145
- DAEMON_JSON_PATH="/etc/docker/daemon.json"
146
- if [ ! -f "$DAEMON_JSON_PATH" ] || [ "$(cat $DAEMON_JSON_PATH)" != "$DESIRED_DAEMON_JSON" ]; then
147
- echo "${BLUE}Creating/updating $DAEMON_JSON_PATH with the desired content...${RESET}"
148
- echo "$DESIRED_DAEMON_JSON" | sudo tee $DAEMON_JSON_PATH > /dev/null
149
- sudo systemctl restart docker
150
- echo "${GREEN}$DAEMON_JSON_PATH has been created/updated.${RESET}"
151
- else
152
- echo "${GREEN}$DAEMON_JSON_PATH already exists and has the correct content.${RESET}"
153
- fi
154
-
155
- # Install additional packages
156
- for PACKAGE in $PACKAGES; do
157
- if ! dpkg -l | grep -qw "$PACKAGE"; then
158
- echo "${CYAN}$PACKAGE${RESET} ${BLUE}is not installed. Installing $PACKAGE...${RESET}"
159
- sudo apt-get install -y $PACKAGE
160
- else
161
- echo "${GREEN}$PACKAGE${RESET} is already installed: ${GREEN}OK!${RESET}"
162
- fi
163
- done
7
+ # create folder.
8
+ BASE_PATH=/home/$USER/reComputer
9
+ mkdir -p $BASE_PATH/
@@ -6,7 +6,7 @@ IMAGE_NAME="yaohui1998/comfyui"
6
6
  # Pull the latest image
7
7
  docker pull $IMAGE_NAME
8
8
 
9
- cd ~/
9
+ cd /home/$USER/reComputer/
10
10
  git clone https://github.com/comfyanonymous/ComfyUI.git
11
11
 
12
12
 
@@ -21,7 +21,7 @@ else
21
21
  --name $CONTAINER_NAME \
22
22
  --privileged \
23
23
  --network host \
24
- -v ~/ComfyUI:/usr/src/ComfyUI-Seeed \
24
+ -v /home/$USER/reComputer/ComfyUI:/usr/src/ComfyUI-Seeed \
25
25
  -v /tmp/.X11-unix:/tmp/.X11-unix \
26
26
  -v /dev/*:/dev/* \
27
27
  -v /etc/localtime:/etc/localtime:ro \
@@ -0,0 +1,31 @@
1
+ # The tested JetPack versions.
2
+ ALLOWED_L4T_VERSIONS:
3
+ - 35.3.1
4
+ - 35.4.1
5
+ - 35.5.0
6
+ - 36.3.0
7
+ REQUIRED_DISK_SPACE: 15 # in GB
8
+ REQUIRED_MEM_SPACE: 7
9
+ PACKAGES:
10
+ - nvidia-jetpack
11
+ DOCKER:
12
+ ENABLE: true
13
+ DAEMON: |
14
+ {
15
+ "default-runtime": "nvidia",
16
+ "runtimes": {
17
+ "nvidia": {
18
+ "path": "nvidia-container-runtime",
19
+ "runtimeArgs": []
20
+ }
21
+ },
22
+ "storage-driver": "overlay2",
23
+ "data-root": "/var/lib/docker",
24
+ "log-driver": "json-file",
25
+ "log-opts": {
26
+ "max-size": "100m",
27
+ "max-file": "3"
28
+ },
29
+ "no-new-privileges": true,
30
+ "experimental": false
31
+ }
@@ -1,5 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
+ # check the runtime environment.
4
+ source $(dirname "$(realpath "$0")")/../utils.sh
5
+ check_base_env "$(dirname "$(realpath "$0")")/config.yaml"
3
6
 
4
7
  BASE_PATH=/home/$USER/reComputer
5
8
  mkdir -p $BASE_PATH/
@@ -0,0 +1,31 @@
1
+ # The tested JetPack versions.
2
+ ALLOWED_L4T_VERSIONS:
3
+ - 35.3.1
4
+ - 35.4.1
5
+ - 35.5.0
6
+ - 36.3.0
7
+ REQUIRED_DISK_SPACE: 15 # in GB
8
+ REQUIRED_MEM_SPACE: 7
9
+ PACKAGES:
10
+ - nvidia-jetpack
11
+ DOCKER:
12
+ ENABLE: true
13
+ DAEMON: |
14
+ {
15
+ "default-runtime": "nvidia",
16
+ "runtimes": {
17
+ "nvidia": {
18
+ "path": "nvidia-container-runtime",
19
+ "runtimeArgs": []
20
+ }
21
+ },
22
+ "storage-driver": "overlay2",
23
+ "data-root": "/var/lib/docker",
24
+ "log-driver": "json-file",
25
+ "log-opts": {
26
+ "max-size": "100m",
27
+ "max-file": "3"
28
+ },
29
+ "no-new-privileges": true,
30
+ "experimental": false
31
+ }
@@ -1,5 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
+ # check the runtime environment.
4
+ source $(dirname "$(realpath "$0")")/../utils.sh
5
+ check_base_env "$(dirname "$(realpath "$0")")/config.yaml"
3
6
 
4
7
  BASE_PATH=/home/$USER/reComputer
5
8
  mkdir -p $BASE_PATH/
@@ -1,17 +1,16 @@
1
- allowed_l4t_versions:
1
+ # The tested JetPack versions.
2
+ ALLOWED_L4T_VERSIONS:
2
3
  - 35.3.1
3
4
  - 35.4.1
4
5
  - 35.5.0
5
- - 36.3.0 # Add your version here
6
- required_disk_space: 20 # in GB
7
- min_mem_gb: 4
8
- min_swap_gb: 2
9
- nvidia_jetson_package: "nvidia-jetpack"
10
- packages:
11
- #- "ros-noetic-ros-base"
12
- #- "flask"
13
- docker:
14
- desired_daemon_json: |
6
+ - 36.3.0
7
+ REQUIRED_DISK_SPACE: 20 # in GB
8
+ REQUIRED_MEM_SPACE: 4
9
+ PACKAGES:
10
+ - nvidia-jetpack
11
+ DOCKER:
12
+ ENABLE: true
13
+ DAEMON: |
15
14
  {
16
15
  "default-runtime": "nvidia",
17
16
  "runtimes": {
@@ -1,176 +1,4 @@
1
1
  #!/bin/bash
2
- #set color value
3
- RED=$(tput setaf 1)
4
- GREEN=$(tput setaf 2)
5
- YELLOW=$(tput setaf 3)
6
- BLUE=$(tput setaf 4)
7
- MAGENTA=$(tput setaf 5)
8
- CYAN=$(tput setaf 6)
9
- RESET=$(tput sgr0)
10
2
 
11
- echo "${CYAN}This script will install the necessary packages and configurations for running ultralytics-yolo on a Jetson Nano.${RESET}"
12
-
13
- # Install yq for parsing YAML files
14
- if ! command -v yq &> /dev/null
15
- then
16
- echo "yq is not installed. Installing yq with pip3..."
17
- pip3 install yq
18
- if command -v yq &> /dev/null
19
- then
20
- echo "yq has been successfully installed."
21
- else
22
- echo "Failed to install yq."
23
- exit 1
24
- fi
25
- else
26
- echo "yq is already installed."
27
- fi
28
-
29
- # Read configuration
30
- CURRENT_DIR="ultralytics-yolo"
31
- CONFIG_FILE="${(dirname "$(realpath "$0")")}/config.yaml"
32
- ALLOWED_L4T_VERSIONS=$(yq -r '.allowed_l4t_versions[]' $CONFIG_FILE)
33
- ALLOWED_L4T_VERSIONS_ARRAY=($ALLOWED_L4T_VERSIONS)
34
- REQUIRED_DISK_SPACE=$(yq -r '.required_disk_space' $CONFIG_FILE)
35
- MIN_MEM_GB=$(yq -r '.min_mem_gb' $CONFIG_FILE)
36
- MIN_SWAP_GB=$(yq -r '.min_swap_gb' $CONFIG_FILE)
37
- NVIDIA_JETSON_PACKAGE=$(yq -r '.nvidia_jetson_package' $CONFIG_FILE)
38
- PACKAGES=$(yq -r '.packages[]' $CONFIG_FILE)
39
- DESIRED_DAEMON_JSON=$(yq -r '.docker.desired_daemon_json' $CONFIG_FILE)
40
- CURRENT_DISK_SPACE=$(df -BG --output=avail / | tail -1 | sed 's/[^0-9]*//g')
41
- MEM_GB=$(free -g | awk '/^Mem:/{print $2}')
42
- SWAP_GB=$(free -g | awk '/^Swap:/{print $2}')
43
-
44
- echo "${MAGENTA}Allowed L4T versions:${RESET} ${GREEN}$ALLOWED_L4T_VERSIONS ${RESET}"
45
- echo "${MAGENTA}Required disk space: ${GREEN}${REQUIRED_DISK_SPACE}G ${RESET}"
46
- echo "${MAGENTA}Minimum memory: ${GREEN}${MIN_MEM_GB}G ${RESET}"
47
- echo "${MAGENTA}Minimum swap: ${GREEN}${MIN_SWAP_GB}G ${RESET}"
48
- echo "${MAGENTA}NVIDIA Jetson package:${RESET} ${GREEN}$NVIDIA_JETSON_PACKAGE ${RESET}"
49
- echo "${MAGENTA}Additional packages: ${RESET} ${GREEN}$PACKAGES ${RESET}"
50
-
51
- # Check if NVIDIA Jetson package is installed
52
- if ! dpkg -l | grep -qw "$NVIDIA_JETSON_PACKAGE"; then
53
- echo "$NVIDIA_JETSON_PACKAGE is not installed. Installing $NVIDIA_JETSON_PACKAGE..."
54
- sudo apt-get install -y $NVIDIA_JETSON_PACKAGE
55
- else
56
- echo "$NVIDIA_JETSON_PACKAGE is installed: ${GREEN}OK!${RESET}"
57
- fi
58
-
59
- # Install additional packages
60
- for PACKAGE in $PACKAGES; do
61
- if ! dpkg -l | grep -qw "$PACKAGE"; then
62
- echo "$PACKAGE is not installed. Installing $PACKAGE..."
63
- sudo apt-get install -y $PACKAGE
64
- else
65
- echo "$PACKAGE is installed: ${GREEN}OK!${RESET}"
66
- fi
67
- done
68
-
69
- # Get system architecture
70
- ARCH=$(uname -i)
71
- if [ "$ARCH" = "aarch64" ]; then
72
- # Check for L4T version string
73
- L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)
74
-
75
- if [ -z "$L4T_VERSION_STRING" ]; then
76
- L4T_VERSION_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
77
- fi
78
-
79
- L4T_RELEASE=$(echo "$L4T_VERSION_STRING" | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
80
- L4T_REVISION=$(echo "$L4T_VERSION_STRING" | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
81
- L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
82
-
83
- elif [ "$ARCH" = "x86_64" ]; then
84
- echo "${RED}Unsupported architecture: $ARCH${RESET}"
85
- exit 1
86
- fi
87
-
88
-
89
- # Check L4T version
90
- if [[ " ${ALLOWED_L4T_VERSIONS_ARRAY[@]} " =~ " ${L4T_VERSION} " ]]; then
91
- echo "L4T VERSION ${GREEN}${L4T_VERSION}${RESET} is in the allowed: ${GREEN}OK!${RESET}"
92
- else
93
- echo "${RED}L4T VERSION ${GREEN}${L4T_VERSION}${RESET}${RED} is not in the allowed versions list.${RESET}"
94
- exit 1
95
- fi
96
-
97
- # Check disk space
98
- if [ "$CURRENT_DISK_SPACE" -lt "$REQUIRED_DISK_SPACE" ]; then
99
- echo "${RED}Insufficient disk space. Required: ${REQUIRED_DISK_SPACE}G, Available: ${CURRENT_DISK_SPACE}G. ${RESET}"
100
- exit 1
101
- else
102
- echo "Required ${GREEN}${REQUIRED_DISK_SPACE}${RESET} G disk space: ${GREEN}OK!${RESET}"
103
- fi
104
-
105
- # Check memory and swap space
106
- if [ "$MEM_GB" -lt "$MIN_MEM_GB" ]; then
107
- echo "${RED}Insufficient memory: $MEM_GB GB (minimum required: $MIN_MEM_GB GB).${RESET}"
108
- exit 1
109
- else
110
- echo "Required ${GREEN}$MIN_MEM_GB${RESET} G memory space: ${GREEN}OK!${RESET}"
111
- fi
112
-
113
- if [ "$SWAP_GB" -lt "$MIN_SWAP_GB" ]; then
114
- echo "${RED}Insufficient swap space: $SWAP_GB GB (minimum required: $MIN_SWAP_GB GB). ${RESET}"
115
- exit 1
116
- else
117
- echo "Required ${GREEN}$MIN_SWAP_GB${RESET} G swap space: ${GREEN}OK!${RESET}"
118
- fi
119
-
120
- # Check if Docker is installed
121
- if ! command -v docker &> /dev/null; then
122
- echo "${BLUE}Docker is not installed. Installing Docker...${RESET}"
123
-
124
- sudo apt-get install -y \
125
- apt-transport-https \
126
- ca-certificates \
127
- curl \
128
- software-properties-common
129
-
130
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
131
- sudo add-apt-repository \
132
- "deb [arch=arm64] https://download.docker.com/linux/ubuntu \
133
- $(lsb_release -cs) \
134
- stable"
135
-
136
- sudo apt-get update
137
- sudo apt-get install -y docker-ce
138
- sudo systemctl enable docker
139
- sudo systemctl start docker
140
- sudo usermod -aG docker $USER
141
- sudo systemctl restart docker
142
- newgrp docker
143
-
144
- echo "Docker has been installed and configured."
145
- fi
146
-
147
- # Check if the current user has permissions to use Docker
148
- if ! docker info &> /dev/null; then
149
- echo "The current user does not have permissions to use Docker. Adding permissions..."
150
- sudo usermod -aG docker $USER
151
- sudo systemctl restart docker
152
- newgrp docker
153
- echo "${BLUE}Permissions added. Please log out and log back in for the changes to take effect.${RESET}"
154
- else
155
- echo "${GREEN}Docker is installed and the current user has permissions to use it.${RESET}"
156
- fi
157
-
158
- DAEMON_JSON_PATH="/etc/docker/daemon.json"
159
- if [ ! -f "$DAEMON_JSON_PATH" ] || [ "$(cat $DAEMON_JSON_PATH)" != "$DESIRED_DAEMON_JSON" ]; then
160
- echo "${BLUE}Creating/updating $DAEMON_JSON_PATH with the desired content...${RESET}"
161
- echo "$DESIRED_DAEMON_JSON" | sudo tee $DAEMON_JSON_PATH > /dev/null
162
- sudo systemctl restart docker
163
- echo "${GREEN}$DAEMON_JSON_PATH has been created/updated.${RESET}"
164
- else
165
- echo "${GREEN}$DAEMON_JSON_PATH already exists and has the correct content.${RESET}"
166
- fi
167
-
168
- # Install additional packages
169
- for PACKAGE in $PACKAGES; do
170
- if ! dpkg -l | grep -qw "$PACKAGE"; then
171
- echo "${CYAN}$PACKAGE${RESET} ${BLUE}is not installed. Installing $PACKAGE...${RESET}"
172
- sudo apt-get install -y $PACKAGE
173
- else
174
- echo "${GREEN}$PACKAGE${RESET} is already installed: ${GREEN}OK!${RESET}"
175
- fi
176
- done
3
+ source $(dirname "$(realpath "$0")")/../utils.sh
4
+ check_base_env "$(dirname "$(realpath "$0")")/config.yaml"
@@ -9,6 +9,7 @@ docker pull $IMAGE_NAME
9
9
  # Check if the container with the specified name already exists
10
10
  if [ $(docker ps -a -q -f name=^/${CONTAINER_NAME}$) ]; then
11
11
  echo "Container $CONTAINER_NAME already exists. Starting and attaching..."
12
+ echo "Please open http://127.0.0.1:5001 to access the WebUI."
12
13
  docker start $CONTAINER_NAME
13
14
  docker exec -it $CONTAINER_NAME /bin/bash
14
15
  else
@@ -0,0 +1,168 @@
1
+ #!/bin/bash
2
+
3
+ check_base_env()
4
+ {
5
+ # 1. Set color value
6
+ RED=$(tput setaf 1)
7
+ GREEN=$(tput setaf 2)
8
+ YELLOW=$(tput setaf 3)
9
+ BLUE=$(tput setaf 4)
10
+ MAGENTA=$(tput setaf 5)
11
+ CYAN=$(tput setaf 6)
12
+ RESET=$(tput sgr0)
13
+
14
+ # 2. Load config file
15
+ local CONFIG_FILE=$1
16
+ echo "CONFIG_FILE_PATH=$CONFIG_FILE"
17
+
18
+ if [[ ! -f "$CONFIG_FILE" ]]; then
19
+ echo "Error: YAML file '$CONFIG_FILE' not found."
20
+ return 1
21
+ fi
22
+ # Install yq for parsing YAML file
23
+ if ! command -v yq &> /dev/null
24
+ then
25
+ echo "yq is not installed. Installing yq with pip3..."
26
+ pip3 install yq
27
+ if command -v yq &> /dev/null
28
+ then
29
+ echo "yq has been successfully installed."
30
+ else
31
+ echo "Failed to install yq."
32
+ exit 1
33
+ fi
34
+ else
35
+ echo "yq is already installed."
36
+ fi
37
+
38
+ if ! command -v jq &> /dev/null
39
+ then
40
+ echo "jq is not installed. Installing jq..."
41
+ sudo apt-get update
42
+ sudo apt-get install -y jq
43
+
44
+ if command -v jq &> /dev/null
45
+ then
46
+ echo "jq has been successfully installed."
47
+ jq --version
48
+ else
49
+ echo "Failed to install jq."
50
+ exit 1
51
+ fi
52
+ else
53
+ echo "jq is already installed."
54
+ jq --version
55
+ fi
56
+ ALLOWED_L4T_VERSIONS=($(yq -r '.ALLOWED_L4T_VERSIONS[]' $CONFIG_FILE))
57
+ REQUIRED_DISK_SPACE=$(yq -r '.REQUIRED_DISK_SPACE' $CONFIG_FILE)
58
+ REQUIRED_MEM_SPACE=$(yq -r '.REQUIRED_MEM_SPACE' $CONFIG_FILE)
59
+ PACKAGES=($(yq -r '.PACKAGES[]' $CONFIG_FILE))
60
+ DOCKER=$(yq -r '.DOCKER.ENABLE' $CONFIG_FILE)
61
+ DESIRED_DAEMON_JSON=$(yq -r '.DOCKER.DAEMON' $CONFIG_FILE)
62
+ echo "${ALLOWED_L4T_VERSIONS[@]}"
63
+ # 3. Check L4T version
64
+ ARCH=$(uname -i)
65
+ if [ "$ARCH" = "aarch64" ]; then
66
+ # Check for L4T version string
67
+ L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)
68
+
69
+ if [ -z "$L4T_VERSION_STRING" ]; then
70
+ L4T_VERSION_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
71
+ fi
72
+
73
+ L4T_RELEASE=$(echo "$L4T_VERSION_STRING" | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
74
+ L4T_REVISION=$(echo "$L4T_VERSION_STRING" | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
75
+ L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
76
+
77
+ elif [ "$ARCH" = "x86_64" ]; then
78
+ echo "${RED}Unsupported architecture: $ARCH${RESET}"
79
+ exit 1
80
+ fi
81
+
82
+ if [[ " ${ALLOWED_L4T_VERSIONS[@]} " =~ " ${L4T_VERSION} " ]]; then
83
+ echo "L4T VERSION ${GREEN}${L4T_VERSION}${RESET} is in the allowed: ${GREEN}OK!${RESET}"
84
+ else
85
+ echo "${RED}L4T VERSION ${GREEN}${L4T_VERSION}${RESET}${RED} is not in the allowed versions list.${RESET}"
86
+ echo "${RED}The JetPack versions currently supported by this container are: ${GREEN}${ALLOWED_L4T_VERSIONS[@]}${RESET}${RED}. ${RESET}"
87
+ echo "${RED}For more information : https://github.com/Seeed-Projects/jetson-examples ${RESET}"
88
+ exit 1
89
+ fi
90
+
91
+ # Install additional apt packages
92
+ for PACKAGE in $PACKAGES; do
93
+ if ! dpkg -l | grep -qw "$PACKAGE"; then
94
+ echo "Installing $PACKAGE..."
95
+ sudo apt-get install -y $PACKAGE
96
+ fi
97
+ echo "$PACKAGE is installed: ${GREEN}OK!${RESET}"
98
+ done
99
+
100
+ # 4. Check disk space
101
+ CURRENT_DISK_SPACE=$(df -BG --output=avail / | tail -1 | sed 's/[^0-9]*//g')
102
+ if [ "$CURRENT_DISK_SPACE" -lt "$REQUIRED_DISK_SPACE" ]; then
103
+ echo "${RED}Insufficient disk space. Required: ${REQUIRED_DISK_SPACE}G, Available: ${CURRENT_DISK_SPACE}G. ${RESET}"
104
+ exit 1
105
+ else
106
+ echo "Required ${GREEN}${REQUIRED_DISK_SPACE}GB${RESET}/${GREEN}${CURRENT_DISK_SPACE}GB${RESET} disk space: ${GREEN}OK!${RESET}"
107
+ fi
108
+
109
+ # 5. Check memory space
110
+ CURRENT_MEM_SPACE=$(free -g | awk '/^Mem:/{print $2}')
111
+ if [ "$CURRENT_MEM_SPACE" -lt "$REQUIRED_MEM_SPACE" ]; then
112
+ echo "${RED}Insufficient memory: $CURRENT_MEM_SPACE GB (minimum required: $REQUIRED_MEM_SPACE GB).${RESET}"
113
+ exit 1
114
+ else
115
+ echo "Required ${GREEN}${REQUIRED_MEM_SPACE}GB${RESET}/${GREEN}${CURRENT_MEM_SPACE}GB${RESET} memory space: ${GREEN}OK!${RESET}"
116
+ fi
117
+
118
+ # 6. Prepare Docker env
119
+ if [ "$DOCKER" = "true" ]; then
120
+ # 6.1 Check if Docker is installed
121
+ if ! command -v docker &> /dev/null; then
122
+ echo "${BLUE}Docker is not installed. Installing Docker...${RESET}"
123
+ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
124
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
125
+ sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
126
+
127
+ sudo apt-get update
128
+ sudo apt-get install -y docker-ce
129
+ sudo systemctl enable docker
130
+ sudo systemctl start docker
131
+ sudo usermod -aG docker $USER
132
+ sudo systemctl restart docker
133
+ newgrp docker
134
+
135
+ echo "Docker has been installed and configured."
136
+ fi
137
+ # 6.2 Modify the Docker configuration file
138
+ DAEMON_JSON_PATH="/etc/docker/daemon.json"
139
+ if [ ! -f "$DAEMON_JSON_PATH" ]; then
140
+ echo "${BLUE}Creating $DAEMON_JSON_PATH with the desired content...${RESET}"
141
+ echo "$DESIRED_DAEMON_JSON" | sudo tee $DAEMON_JSON_PATH > /dev/null
142
+ sudo systemctl restart docker
143
+ echo "${GREEN}$DAEMON_JSON_PATH has been created.${RESET}"
144
+ elif [ "$(cat $DAEMON_JSON_PATH)" != "$DESIRED_DAEMON_JSON" ]; then
145
+ echo "${BLUE}Backing up the existing $DAEMON_JSON_PATH to /etc/docker/daemon_backup.json ...${RESET}"
146
+ sudo cp "$DAEMON_JSON_PATH" "/etc/docker/daemon_backup.json"
147
+ echo "${GREEN}Backup completed.${RESET}"
148
+ echo "${BLUE}Updating $DAEMON_JSON_PATH with the desired content...${RESET}"
149
+ echo "$DESIRED_DAEMON_JSON" | sudo tee $DAEMON_JSON_PATH > /dev/null
150
+ sudo systemctl restart docker
151
+ echo "${GREEN}$DAEMON_JSON_PATH has been updated.${RESET}"
152
+ else
153
+ echo "${GREEN}$DAEMON_JSON_PATH already exists and has the correct content.${RESET}"
154
+ fi
155
+ # 6.3 Check permissions
156
+ if ! docker info &> /dev/null; then
157
+ echo "The current user does not have permissions to use Docker. Adding permissions..."
158
+ sudo usermod -aG docker $USER
159
+ sudo systemctl restart docker
160
+ echo "${BLUE}Permissions added. Please rerun the command.${RESET}"
161
+ newgrp docker
162
+ else
163
+ echo "${GREEN}Docker is installed and the current user has permissions to use it.${RESET}"
164
+ fi
165
+ else
166
+ echo "No need to configure Docker."
167
+ fi
168
+ }
@@ -0,0 +1,31 @@
1
+ # The tested JetPack versions.
2
+ ALLOWED_L4T_VERSIONS:
3
+ - 35.3.1
4
+ - 35.4.1
5
+ - 35.5.0
6
+ - 36.3.0
7
+ REQUIRED_DISK_SPACE: 20 # in GB
8
+ REQUIRED_MEM_SPACE: 4
9
+ PACKAGES:
10
+ - nvidia-jetpack
11
+ DOCKER:
12
+ ENABLE: true
13
+ DAEMON: |
14
+ {
15
+ "default-runtime": "nvidia",
16
+ "runtimes": {
17
+ "nvidia": {
18
+ "path": "nvidia-container-runtime",
19
+ "runtimeArgs": []
20
+ }
21
+ },
22
+ "storage-driver": "overlay2",
23
+ "data-root": "/var/lib/docker",
24
+ "log-driver": "json-file",
25
+ "log-opts": {
26
+ "max-size": "100m",
27
+ "max-file": "3"
28
+ },
29
+ "no-new-privileges": true,
30
+ "experimental": false
31
+ }
@@ -1,39 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
-
4
- # check L4T_VERSION
5
- # reference https://github.com/dusty-nv/jetson-containers/blob/master/jetson_containers/l4t_version.sh
6
- ALLOWED_L4T_VERSIONS=("35.3.1")
7
-
8
- ARCH=$(uname -i)
9
- if [ $ARCH = "aarch64" ]; then
10
- L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)
11
-
12
- if [ -z "$L4T_VERSION_STRING" ]; then
13
- L4T_VERSION_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
14
- L4T_VERSION_ARRAY=(${L4T_VERSION_STRING//./ })
15
- L4T_RELEASE=${L4T_VERSION_ARRAY[0]}
16
- L4T_REVISION=${L4T_VERSION_ARRAY[1]}
17
- else
18
- L4T_RELEASE=$(echo $L4T_VERSION_STRING | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
19
- L4T_REVISION=$(echo $L4T_VERSION_STRING | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
20
- fi
21
-
22
- L4T_REVISION_MAJOR=${L4T_REVISION:0:1}
23
- L4T_REVISION_MINOR=${L4T_REVISION:2:1}
24
-
25
- L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
26
- echo $L4T_VERSION
27
- elif [ $ARCH != "x86_64" ]; then
28
- echo "unsupported architecture: $ARCH"
29
- exit 1
30
- fi
31
-
32
- echo "L4T_VERSION: $L4T_VERSION"
33
- if [[ ! " ${ALLOWED_L4T_VERSIONS[@]} " =~ " ${L4T_VERSION} " ]]; then
34
- echo "L4T_VERSION is not in the allowed versions list. Exiting."
35
- exit 1
36
- fi
3
+ source $(dirname "$(realpath "$0")")/../utils.sh
4
+ check_base_env "$(dirname "$(realpath "$0")")/config.yaml"
37
5
 
38
6
  # make dirs
39
7
  BASE_PATH=/home/$USER/reComputer
@@ -0,0 +1,31 @@
1
+ # The tested JetPack versions.
2
+ ALLOWED_L4T_VERSIONS:
3
+ - 35.3.1
4
+ - 35.4.1
5
+ - 35.5.0
6
+ - 36.3.0
7
+ REQUIRED_DISK_SPACE: 20 # in GB
8
+ REQUIRED_MEM_SPACE: 4
9
+ PACKAGES:
10
+ - nvidia-jetpack
11
+ DOCKER:
12
+ ENABLE: true
13
+ DAEMON: |
14
+ {
15
+ "default-runtime": "nvidia",
16
+ "runtimes": {
17
+ "nvidia": {
18
+ "path": "nvidia-container-runtime",
19
+ "runtimeArgs": []
20
+ }
21
+ },
22
+ "storage-driver": "overlay2",
23
+ "data-root": "/var/lib/docker",
24
+ "log-driver": "json-file",
25
+ "log-opts": {
26
+ "max-size": "100m",
27
+ "max-file": "3"
28
+ },
29
+ "no-new-privileges": true,
30
+ "experimental": false
31
+ }
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ source $(dirname "$(realpath "$0")")/../utils.sh
4
+ check_base_env "$(dirname "$(realpath "$0")")/config.yaml"
5
+