@@ -26,7 +26,6 @@ enable_model_converter=0 # model-converter tool for VGF output
2626enable_vgf_lib=0 # vgf reader - runtime backend dependency
2727enable_emulation_layer=0 # Vulkan layer driver - emulates Vulkan ML extensions
2828enable_vulkan_sdk=0 # Download and export Vulkan SDK required by emulation layer
29- enable_mlsdk_pip_install=0 # This is a temporary option that will soon be the default
3029
3130# Figure out if setup.sh was called or sourced and save it into "is_script_sourced"
3231(return 0 2> /dev/null) && is_script_sourced=1 || is_script_sourced=0
@@ -52,7 +51,6 @@ OPTION_LIST=(
5251 " --enable-emulation-layer Enable MLSDK Vulkan emulation layer"
5352 " --disable-ethos-u-deps Do not setup what is needed for Ethos-U"
5453 " --enable-mlsdk-deps Setup what is needed for MLSDK"
55- " --install-mlsdk-deps-with-pip Use MLSDK PyPi package instead of building from source"
5654 " --mlsdk-manifest-url URL to the MLSDK manifest for vulkan."
5755 " --help Display help"
5856)
@@ -142,10 +140,6 @@ function check_options() {
142140 enable_vela=0
143141 shift
144142 ;;
145- --install-mlsdk-deps-with-pip)
146- enable_mlsdk_pip_install=1
147- shift
148- ;;
149143 --enable-mlsdk-deps)
150144 enable_model_converter=1
151145 enable_vgf_lib=1
@@ -182,22 +176,12 @@ function setup_ethos_u_tools() {
182176 CMAKE_POLICY_VERSION_MINIMUM=3.5 BUILD_PYBIND=1 pip install --no-dependencies -r $et_dir /backends/arm/requirements-arm-ethos-u.txt
183177}
184178
185- function setup_mlsdk_dependencies() {
186- log_step " mlsdk" " Installing MLSDK dependencies from pip"
187- pip install -r $et_dir /backends/arm/requirements-arm-vgf.txt
188- }
189-
190179function create_setup_path(){
191180 cd " ${root_dir} "
192181
193182 clear_setup_path
194183 log_step " path" " Generating setup path scripts at ${setup_path_script} "
195184
196- local use_mlsdk_pip=0
197- if use_mlsdk_pip_package; then
198- use_mlsdk_pip=1
199- fi
200-
201185 if [[ " ${enable_fvps} " -eq 1 ]]; then
202186 setup_path_fvp
203187 fi
@@ -210,48 +194,19 @@ function create_setup_path(){
210194 setup_path_vulkan
211195 fi
212196
213- if [[ " ${enable_model_converter} " -eq 1 && " ${use_mlsdk_pip} " -eq 0 ]]; then
197+ if [[ " ${enable_model_converter} " -eq 1 ]]; then
214198 setup_path_model_converter
215199 fi
216200
217- if [[ " ${enable_vgf_lib} " -eq 1 && " ${use_mlsdk_pip} " -eq 0 ]]; then
201+ if [[ " ${enable_vgf_lib} " -eq 1 ]]; then
218202 setup_path_vgf_lib
219203 fi
220204
221205 if [[ " ${enable_emulation_layer} " -eq 1 ]]; then
222- if [[ " ${use_mlsdk_pip} " -eq 0 ]]; then
223- setup_path_emulation_layer
224- else
225- setup_path_emulation_layer_from_pip
226- fi
227- fi
228-
229- log_step " path" " Update PATH by sourcing ${setup_path_script} .{sh|fish}"
230- }
231-
232- function use_mlsdk_pip_package() {
233- os=$( uname -s)
234- arch=$( uname -m)
235-
236- if [[ " ${enable_mlsdk_pip_install} " -eq 0 ]]; then
237- return 1
238- fi
239-
240- if [[ " $os " == " Darwin" ]]; then
241- if [[ " ${enable_mlsdk_pip_install} " -eq 1 ]]; then
242- log_step " mlsdk" " [error] MLSDK pip install not yet supported on MacOS"
243- exit 1
244- fi
245- fi
246-
247- if [[ " $arch " == " arm64" || " $arch " == " aarch64" ]]; then
248- if [[ " ${enable_mlsdk_pip_install} " -eq 1 ]]; then
249- log_step " mlsdk" " [error] MLSDK pip install not yet supported on aarch64"
250- exit 1
251- fi
206+ setup_path_emulation_layer
252207 fi
253208
254- return 0
209+ log_step " path " " Update PATH by sourcing ${setup_path_script} .{sh|fish} "
255210}
256211
257212
@@ -269,7 +224,6 @@ if [[ $is_script_sourced -eq 0 ]]; then
269224 source $et_dir /backends/arm/scripts/fvp_utils.sh
270225 source $et_dir /backends/arm/scripts/toolchain_utils.sh
271226 source $et_dir /backends/arm/scripts/vulkan_utils.sh
272- source $et_dir /backends/arm/scripts/mlsdk_utils.sh
273227
274228 log_step " main" " Checking platform and OS"
275229 check_platform_support
@@ -285,12 +239,8 @@ if [[ $is_script_sourced -eq 0 ]]; then
285239 mlsdk_manifest_dir=" ${root_dir} /${mlsdk_manifest_dir} "
286240 fi
287241
288- log_step " options" \
289- " root=${root_dir} , target-toolchain=${target_toolchain:- <default>} , mlsdk-dir=${mlsdk_manifest_dir} "
290- log_step " options" \
291- " ethos-u: fvps=${enable_fvps} , toolchain=${enable_baremetal_toolchain} , vela=${enable_vela} | " \
292- " mlsdk: model-converter=${enable_model_converter} , vgf-lib=${enable_vgf_lib} , " \
293- " emu-layer=${enable_emulation_layer} , vulkan-sdk=${enable_vulkan_sdk} "
242+ log_step " options" " root=${root_dir} , target-toolchain=${target_toolchain:- <default>} , mlsdk-dir=${mlsdk_manifest_dir} "
243+ log_step " options" " ethos-u: fvps=${enable_fvps} , toolchain=${enable_baremetal_toolchain} , vela=${enable_vela} | mlsdk: model-converter=${enable_model_converter} , vgf-lib=${enable_vgf_lib} , emu-layer=${enable_emulation_layer} , vulkan-sdk=${enable_vulkan_sdk} "
294244
295245 # Setup toolchain
296246 if [[ " ${enable_baremetal_toolchain} " -eq 1 ]]; then
@@ -317,18 +267,13 @@ if [[ $is_script_sourced -eq 0 ]]; then
317267 if [[ " ${enable_model_converter} " -eq 1 || \
318268 " ${enable_vgf_lib} " -eq 1 || \
319269 " ${enable_emulation_layer} " -eq 1 ]]; then
320- log_step " mlsdk" " Configuring MLSDK components (model-converter=${enable_model_converter} , " \
321- " vgf-lib=${enable_vgf_lib} , emu-layer=${enable_emulation_layer} )"
322- if use_mlsdk_pip_package; then
323- setup_mlsdk_dependencies
324- else
325- log_step " mlsdk" " Installing MLSDK dependencies from source"
326- setup_mlsdk ${root_dir} \
327- ${mlsdk_manifest_dir} \
328- ${enable_model_converter} \
329- ${enable_vgf_lib} \
330- ${enable_emulation_layer}
331- fi
270+ log_step " mlsdk" " Configuring MLSDK components (model-converter=${enable_model_converter} , vgf-lib=${enable_vgf_lib} , emu-layer=${enable_emulation_layer} )"
271+ source $et_dir /backends/arm/scripts/mlsdk_utils.sh
272+ setup_mlsdk " ${root_dir} " \
273+ " ${mlsdk_manifest_dir} " \
274+ " ${enable_model_converter} " \
275+ " ${enable_vgf_lib} " \
276+ " ${enable_emulation_layer} "
332277 fi
333278
334279 # Create the setup_path.sh used to create the PATH variable for shell
0 commit comments