Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/scripts/install-torch-tensorrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ if [[ $(uname -m) == "aarch64" ]]; then
install_cuda_aarch64
fi

pip install cuda-toolkit

# Install all the dependencies required for Torch-TensorRT
pip install --pre -r ${PWD}/tests/py/requirements.txt
# dependencies in the tests/py/requirements.txt might install a different version of torch or torchvision
Expand Down
15 changes: 11 additions & 4 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@ set -x
# Install dependencies
python3 -m pip install pyyaml

# CU_VERSION: cu130, cu129, etc.
# CU_MAJOR_VERSION: 13, 12, etc.
# CU_MINOR_VERSION: 0, 9, etc.
CU_MAJOR_VERSION=${CU_VERSION:2:4}
CU_MINOR_VERSION=${CU_VERSION:4:5}
ctk_name="cuda-toolkit-${CU_MAJOR_VERSION}-${CU_MINOR_VERSION}"

if [[ $(uname -m) == "aarch64" ]]; then
IS_AARCH64=true
BAZEL_PLATFORM=arm64
os_name=$(cat /etc/os-release | grep -w "ID" | cut -d= -f2)
if [[ ${os_name} == "ubuntu" ]]; then
IS_JETPACK=true
apt-get update
apt-get install -y ninja-build gettext curl libopenblas-dev zip unzip libfmt-dev
apt-get install -y ninja-build gettext curl libopenblas-dev zip unzip libfmt-dev ${ctk_name}
else
IS_SBSA=true
yum install -y ninja-build gettext zip unzip
yum install -y fmt-devel
yum install -y fmt-devel ${ctk_name}
fi
else
BAZEL_PLATFORM="amd64"
yum install -y fmt-devel
yum install -y fmt-devel ${ctk_name}
fi


Expand Down Expand Up @@ -62,7 +69,7 @@ export TORCH_INSTALL_PATH=$(python -c "import torch, os; print(os.path.dirname(t
# CU_UPPERBOUND eg:13.0 or 12.9
# tensorrt tar for linux and windows are different across cuda version
# for sbsa it is the same tar across cuda version
if [[ ${CU_VERSION:2:2} == "13" ]]; then
if [[ ${CU_MAJOR_VERSION} == "13" ]]; then
export CU_UPPERBOUND="13.0"
else
export CU_UPPERBOUND="12.9"
Expand Down
8 changes: 6 additions & 2 deletions packaging/pre_build_script_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ set -x

pip install -U numpy packaging pyyaml setuptools wheel fmt

choco install bazelisk -y
CU_MAJOR_VERSION=${CU_VERSION:2:4}
CU_MINOR_VERSION=${CU_VERSION:4:5}
ctk_name="cuda-toolkit-${CU_MAJOR_VERSION}-${CU_MINOR_VERSION}"

choco install bazelisk ${ctk_name} -y

echo TENSORRT_VERSION=${TENSORRT_VERSION}

Expand Down Expand Up @@ -38,7 +42,7 @@ ls -lart $TORCH_INSTALL_PATH/include/fmt/
# CU_UPPERBOUND eg:13.0 or 12.9
# tensorrt tar for linux and windows are different across cuda version
# for sbsa it is the same tar across cuda version
if [[ ${CU_VERSION:2:2} == "13" ]]; then
if [[ ${CU_MAJOR_VERSION} == "13" ]]; then
export CU_UPPERBOUND="13.0"
else
export CU_UPPERBOUND="12.9"
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ def run(self):
"packaging>=23",
"typing-extensions>=4.7.0",
"dllist",
# dummy package as a WAR for the tensorrt dependency on nvidia-cuda-runtime-cu13
"nvidia-cuda-runtime-cu13==0.0.0a0",
]

cuda_version = torch.version.cuda
Expand Down Expand Up @@ -761,6 +763,7 @@ def get_requirements():
f"{tensorrt_prefix}-bindings>=10.13.0,<10.14.0",
f"{tensorrt_prefix}-libs>=10.13.0,<10.14.0",
]
print(f"{requirements=}")
return requirements


Expand Down
Loading