Update vulkan check

This commit is contained in:
anush elangovan
2022-06-03 23:45:42 +00:00
parent 2c743fec78
commit af6dc91b83
2 changed files with 6 additions and 4 deletions

View File

@@ -111,8 +111,8 @@ if [[ $(uname -s) = 'Linux' ]]; then
fi
$PYTHON -m pip install transformers
$PYTHON -m pip wheel -v -w $TD/wheelhouse $TD -f https://github.com/nod-ai/SHARK-Runtime/releases -f https://github.com/llvm/torch-mlir/releases --extra-index-url https://download.pytorch.org/whl/nightly/cpu
$PYTHON -m pip install . --extra-index-url https://download.pytorch.org/whl/nightly/cpu -f https://github.com/llvm/torch-mlir/releases -f https://github.com/nod-ai/SHARK-Runtime/releases
#$PYTHON -m pip wheel -v -w $TD/wheelhouse $TD -f https://github.com/nod-ai/SHARK-Runtime/releases -f https://github.com/llvm/torch-mlir/releases --extra-index-url https://download.pytorch.org/whl/nightly/cpu
$PYTHON -m pip install -e . --extra-index-url https://download.pytorch.org/whl/nightly/cpu -f https://github.com/llvm/torch-mlir/releases -f https://github.com/nod-ai/SHARK-Runtime/releases
if [[ -z "${CONDA_PREFIX}" ]]; then
echo "${Green}Before running examples activate venv with:"

View File

@@ -92,11 +92,13 @@ def get_iree_gpu_args():
def get_vulkan_triple_flag():
vulkan_device_cmd = "vulkaninfo | grep deviceName | awk \'END{{print $3}}\'"
vulkan_device_cmd = "vulkaninfo | grep deviceName | awk \'END{{print $NF}}\'"
vulkan_device = run_cmd(vulkan_device_cmd).strip()
if vulkan_device == "apple":
if vulkan_device == "M1":
print("Found Apple Device. Using m1-moltenvk-macos")
return "-iree-vulkan-target-triple=m1-moltenvk-macos"
elif vulkan_device == "A100-SXM4-40GB":
print("Found Nvidia Device. Using ampere-rtx3080-linux")
return "-iree-vulkan-target-triple=ampere-rtx3080-linux"
else:
print("Optimized kernel for your target device is not added yet. Contact SHARK Admin on discord or pull up an issue.")