forked from Xilinx/XRT
-
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.
VITIS-11750 Rename exe from xbutil to xrt-smi (Xilinx#8191)
* VITIS-11750 Create a wrapper (e.g. npu-smi) on top of xbutil Signed-off-by: Ryan Chane <[email protected]> * VITIS-11750 Rename npu-smi to xrt-smi Signed-off-by: Ryan Chane <[email protected]> * VITIS-11750 Rename exe from xbutil to xrt-smi and fix related issues Signed-off-by: Ryan Chane <[email protected]> * VITIS-11750 Remove outdated legacy option check Signed-off-by: Ryan Chane <[email protected]> --------- Signed-off-by: Ryan Chane <[email protected]>
- Loading branch information
Showing
9 changed files
with
74 additions
and
30 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. | ||
# | ||
|
||
# -- Detect a Windows environment and automatically switch to the .bat file | ||
if [[ "`uname`" == windows32* ]] || [[ "`uname`" == CYGWIN* ]] ; then | ||
trap "" INT | ||
"$0.bat" "$@" | ||
exit $? | ||
fi | ||
|
||
# Working variables | ||
XRT_PROG=xrt-smi | ||
|
||
# -- Examine the options | ||
XRTWARP_PROG_ARGS_size=0 | ||
XRTWRAP_PROG_ARGS=() | ||
while [ $# -gt 0 ]; do | ||
case "$1" in | ||
# Copy the options the remaining options | ||
*) | ||
XRTWRAP_PROG_ARGS[$XRTWARP_PROG_ARGS_size]="$1" | ||
XRTWARP_PROG_ARGS_size=$(($XRTWARP_PROG_ARGS_size + 1)) | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
# -- Find loader directory | ||
XRT_LOADER_DIR="`dirname \"$0\"`" | ||
|
||
# For edge platforms loader is not required as tools are in standard location(/usr). | ||
# So calling unwrapped tool from this script itself. | ||
if [[ $XRT_LOADER_DIR =~ "/usr" ]]; then | ||
"${XRT_LOADER_DIR}/unwrapped/${XRT_PROG}" "${XRTWRAP_PROG_ARGS[@]}" | ||
exit 0 | ||
fi | ||
|
||
# Call loader for dc platforms | ||
XRT_LOADER="${XRT_LOADER_DIR}/unwrapped/loader" | ||
if [ ! -f "$XRT_LOADER" ]; then | ||
echo "ERROR: Could not find 64-bit loader executable." | ||
echo "ERROR: ${XRT_LOADER} does not exist." | ||
exit 1 | ||
fi | ||
|
||
"${XRT_LOADER}" -exec ${XRT_PROG} "${XRTWRAP_PROG_ARGS[@]}" |
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