Skip to content

Commit 6ceaed8

Browse files
authored
chore: Upgrade to CUDA 12.1 (#2020)
1 parent 8b09e71 commit 6ceaed8

File tree

14 files changed

+74
-89
lines changed

14 files changed

+74
-89
lines changed

.circleci/config.yml

+40-54
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,9 @@ commands:
9292
key: cmake-<< parameters.cache-key >>-<< parameters.version >>
9393
paths:
9494
- << parameters.install-dir >>
95-
uninstall-cuda:
96-
description: "Uninstall CUDA-11.4"
97-
steps:
98-
- run:
99-
name: "Uninstall CUDA-11.4"
100-
command: |
101-
sudo apt-get --purge remove "cuda*" "nsight*"
102-
sudo apt-get --purge remove "*nvidia*"
10395

10496
install-cudnn:
105-
description: "Install CUDNN 8.8.0"
97+
description: "Install CUDNN 8.8.1"
10698
parameters:
10799
os:
108100
type: string
@@ -112,10 +104,10 @@ commands:
112104
default: "x86_64"
113105
cudnn-version:
114106
type: string
115-
default: "8.8.0.121"
107+
default: "8.8.1.3"
116108
cuda-version:
117109
type: string
118-
default: "cuda11.8"
110+
default: "cuda12.0"
119111
steps:
120112
- run:
121113
name: Install CUDNN
@@ -149,13 +141,13 @@ commands:
149141
default: "amd64"
150142
cuda-pkg-name:
151143
type: string
152-
default: "cuda-toolkit-11-8"
144+
default: "cuda-toolkit-12-1"
153145
cuda-pkg-version:
154146
type: string
155-
default: "11-8"
147+
default: "12-1"
156148
cuda-version:
157149
type: string
158-
default: "11.8.0"
150+
default: "12.1.1"
159151
steps:
160152
- run:
161153
name: Install CUDA
@@ -186,21 +178,12 @@ commands:
186178
architecture:
187179
type: string
188180
default: "amd64"
189-
cuda-pkg-name:
190-
type: string
191-
default: "cuda-toolkit-11-8"
192-
cuda-pkg-version:
193-
type: string
194-
default: "11-8"
195-
cuda-version:
196-
type: string
197-
default: "11.8.0"
198181
cuda-string-version:
199182
type: string
200-
default: "cuda11.8"
183+
default: "cuda12.0"
201184
cudnn-version:
202185
type: string
203-
default: "8.8.0.121"
186+
default: "8.8.1.3"
204187
trt-version-short:
205188
type: string
206189
default: "8.6.1"
@@ -252,7 +235,7 @@ commands:
252235
default: "8.6.1"
253236
cudnn-version-long:
254237
type: string
255-
default: "8.8.0.121"
238+
default: "8.8.1.3"
256239
steps:
257240
- run:
258241
name: Set up python environment
@@ -261,27 +244,30 @@ commands:
261244
pip3 install wheel setuptools
262245
pip3 install nvidia-pyindex
263246
pip3 install tabulate
264-
pip3 install tensorrt==<< parameters.trt-version-long >> nvidia-cudnn-cu11==<< parameters.cudnn-version-long >>
247+
pip3 install tensorrt==<< parameters.trt-version-long >> nvidia-cudnn-cu12==<< parameters.cudnn-version-long >>
265248
pip3 install pytest parameterized expecttest nox
266249
267250
install-torch-from-index:
268251
description: "Install Pytorch"
269252
parameters:
270253
torch-build:
271254
type: string
272-
default: "2.1.0.dev20230605+cu118"
255+
default: "2.1.0.dev20230619+cu121"
273256
torchvision-build:
274257
type: string
275-
default: "0.16.0.dev20230605+cu118"
258+
default: "0.16.0.dev20230619+cu121"
276259
torch-build-index:
277260
type: string
278-
default: "https://download.pytorch.org/whl/nightly/cu118"
261+
default: "https://download.pytorch.org/whl/nightly/cu121"
262+
torchvision-build-index:
263+
type: string
264+
default: "https://download.pytorch.org/whl/nightly/cu121"
279265
steps:
280266
- run:
281267
name: Install Torch
282268
command: |
283269
pip3 install --upgrade pip
284-
pip3 install torch==<< parameters.torch-build >> torchvision==<< parameters.torchvision-build >> --extra-index-url << parameters.torch-build-index >>
270+
pip3 install torch==<< parameters.torch-build >> torchvision==<< parameters.torchvision-build >> --extra-index-url << parameters.torch-build-index >> --extra-index-url << parameters.torchvision-build-index >>
285271
286272
build-py:
287273
description: "Build the torch-tensorrt python release (pre-cxx11-abi)"
@@ -293,7 +279,7 @@ commands:
293279
- run:
294280
name: Build torch-tensorrt python release (pre-cxx11-abi)
295281
command: |
296-
export CUDA_HOME=/usr/local/cuda-11.8/
282+
export CUDA_HOME=/usr/local/cuda-12.1/
297283
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
298284
cd py
299285
python3 -m pip install wheel setuptools
@@ -313,7 +299,7 @@ commands:
313299
- run:
314300
name: Build torch-tensorrt python legacy release (pre-cxx11-abi)
315301
command: |
316-
export CUDA_HOME=/usr/local/cuda-11.8/
302+
export CUDA_HOME=/usr/local/cuda-12.1/
317303
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
318304
cd py
319305
python3 -m pip install wheel setuptools
@@ -345,7 +331,7 @@ commands:
345331
- run:
346332
name: Build torch-tensorrt python release package
347333
command: |
348-
export CUDA_HOME=/usr/local/cuda-11.8/
334+
export CUDA_HOME=/usr/local/cuda-12.1/
349335
cd ~/project/py
350336
python3 setup.py bdist_wheel --use-cxx11-abi --release
351337
python3 setup.py install --use-cxx11-abi --release
@@ -357,7 +343,7 @@ commands:
357343
- run:
358344
name: Build torch-tensorrt python package
359345
command: |
360-
export CUDA_HOME=/usr/local/cuda-11.8/
346+
export CUDA_HOME=/usr/local/cuda-12.1/
361347
cd ~/project/py
362348
python3 setup.py bdist_wheel --use-cxx11-abi
363349
python3 setup.py install --use-cxx11-abi
@@ -375,7 +361,7 @@ commands:
375361
- run:
376362
name: Build torch-tensorrt python release with only the fx backend
377363
command: |
378-
export CUDA_HOME=/usr/local/cuda-11.8/
364+
export CUDA_HOME=/usr/local/cuda-12.1/
379365
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
380366
cd py
381367
python3 -m pip install wheel setuptools
@@ -447,7 +433,7 @@ commands:
447433
name: Build torch-tensorrt library with CMake
448434
command: |
449435
mkdir build
450-
export PATH=$PATH:/usr/local/cuda-11.8/bin
436+
export PATH=$PATH:/usr/local/cuda-12.1/bin
451437
~/cmake/bin/cmake -S. -Bbuild \
452438
-DCMAKE_MODULE_PATH=cmake/Module \
453439
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
@@ -499,7 +485,7 @@ commands:
499485
name: Run core / C++ tests
500486
no_output_timeout: 15m
501487
environment:
502-
LD_LIBRARY_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch_tensorrt.libs:/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda-11.8/lib64/:$LD_LIBRARY_PATH"
488+
LD_LIBRARY_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch_tensorrt.libs:/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda-12.1/lib64/:$LD_LIBRARY_PATH"
503489
command: |
504490
set -e
505491
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
@@ -529,7 +515,7 @@ commands:
529515
environment:
530516
USE_HOST_DEPS: "1"
531517
PYT_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/"
532-
LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu/:/usr/local/cuda-11.8/lib64/:$LD_LIBRARY_PATH"
518+
LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu/:/usr/local/cuda-12.1/lib64/:$LD_LIBRARY_PATH"
533519
command: |
534520
set -e
535521
mkdir -p /tmp/artifacts/test_results
@@ -819,7 +805,7 @@ jobs:
819805
type: boolean
820806
default: false
821807
machine:
822-
image: linux-cuda-11:2023.02.1
808+
image: linux-cuda-12:2023.05.1
823809
resource_class: gpu.nvidia.small
824810
steps:
825811
- checkout
@@ -881,7 +867,7 @@ jobs:
881867
cudnn-version:
882868
type: string
883869
machine:
884-
image: linux-cuda-11:2023.02.1
870+
image: linux-cuda-12:2023.05.1
885871
resource_class: gpu.nvidia.large
886872
parallelism: 4
887873
steps:
@@ -922,7 +908,7 @@ jobs:
922908
python-version:
923909
type: string
924910
machine:
925-
image: linux-cuda-11:2023.02.1
911+
image: linux-cuda-12:2023.05.1
926912
resource_class: gpu.nvidia.large
927913
steps:
928914
- checkout
@@ -956,7 +942,7 @@ jobs:
956942
type: string
957943
parallelism: 8
958944
machine:
959-
image: linux-cuda-11:2023.02.1
945+
image: linux-cuda-12:2023.05.1
960946
resource_class: gpu.nvidia.large
961947
steps:
962948
- checkout
@@ -992,7 +978,7 @@ jobs:
992978
type: string
993979
parallelism: 8
994980
machine:
995-
image: linux-cuda-11:2023.02.1
981+
image: linux-cuda-12:2023.05.1
996982
resource_class: gpu.nvidia.large
997983
steps:
998984
- checkout
@@ -1030,7 +1016,7 @@ jobs:
10301016
python-version:
10311017
type: string
10321018
machine:
1033-
image: linux-cuda-11:2023.02.1
1019+
image: linux-cuda-12:2023.05.1
10341020
resource_class: gpu.nvidia.large
10351021
steps:
10361022
- checkout
@@ -1068,7 +1054,7 @@ jobs:
10681054
type: string
10691055
parallelism: 4
10701056
machine:
1071-
image: linux-cuda-11:2023.02.1
1057+
image: linux-cuda-12:2023.05.1
10721058
resource_class: gpu.nvidia.small
10731059
steps:
10741060
- when:
@@ -1116,7 +1102,7 @@ jobs:
11161102
torch-build-index:
11171103
type: string
11181104
machine:
1119-
image: linux-cuda-11:2023.02.1
1105+
image: linux-cuda-12:2023.05.1
11201106
resource_class: gpu.nvidia.small
11211107
steps:
11221108
- when:
@@ -1252,7 +1238,7 @@ jobs:
12521238
python-version:
12531239
type: string
12541240
machine:
1255-
image: linux-cuda-11:2023.02.1
1241+
image: linux-cuda-12:2023.05.1
12561242
resource_class: gpu.nvidia.small
12571243
steps:
12581244
- checkout
@@ -1288,7 +1274,7 @@ jobs:
12881274
torch-base-image:
12891275
type: string
12901276
machine:
1291-
image: linux-cuda-11:2023.02.1
1277+
image: linux-cuda-12:2023.05.1
12921278
resource_class: gpu.nvidia.small
12931279
steps:
12941280
- checkout
@@ -1316,7 +1302,7 @@ jobs:
13161302
torch-base-image:
13171303
type: string
13181304
machine:
1319-
image: linux-cuda-11:2023.02.1
1305+
image: linux-cuda-12:2023.05.1
13201306
resource_class: gpu.nvidia.small
13211307
steps:
13221308
- when:
@@ -1352,13 +1338,13 @@ parameters:
13521338
# Nightly platform config
13531339
torch-build:
13541340
type: string
1355-
default: "2.1.0.dev20230605+cu118"
1341+
default: "2.1.0.dev20230619+cu121"
13561342
torchvision-build:
13571343
type: string
1358-
default: "0.16.0.dev20230605+cu118"
1344+
default: "0.16.0.dev20230619+cu121"
13591345
torch-build-index:
13601346
type: string
1361-
default: "https://download.pytorch.org/whl/nightly/cu118"
1347+
default: "https://download.pytorch.org/whl/nightly/cu121"
13621348
torch-build-legacy:
13631349
type: string
13641350
default: "1.13.1+cu117"
@@ -1373,7 +1359,7 @@ parameters:
13731359
default: true
13741360
cudnn-version:
13751361
type: string
1376-
default: "8.8.0.121"
1362+
default: "8.8.1.3"
13771363
trt-version-short:
13781364
type: string
13791365
default: "8.6.1"

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
116116
These are the following dependencies used to verify the testcases. Torch-TensorRT can work with other versions, but the tests are not guaranteed to pass.
117117

118118
- Bazel 5.2.0
119-
- Libtorch 2.1.0.dev20230605 (built with CUDA 11.8)
120-
- CUDA 11.8
121-
- cuDNN 8.8.0
119+
- Libtorch 2.1.0.dev20230619 (built with CUDA 12.1)
120+
- CUDA 12.1
121+
- cuDNN 8.8.1
122122
- TensorRT 8.6.1
123123

124124
## Prebuilt Binaries and Wheel files

WORKSPACE

+10-10
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local_repository(
4141
new_local_repository(
4242
name = "cuda",
4343
build_file = "@//third_party/cuda:BUILD",
44-
path = "/usr/local/cuda-11.8/",
44+
path = "/usr/local/cuda-12.1/",
4545
)
4646

4747
#############################################################################################################
@@ -51,17 +51,17 @@ new_local_repository(
5151
http_archive(
5252
name = "libtorch",
5353
build_file = "@//third_party/libtorch:BUILD",
54-
sha256 = "999becce82b73e566d0ffe010cd21fea8cf3a33f90f09dcc6b01150b820ae063",
54+
sha256 = "5ba55259b65e071346a2b547b8d1378595f1467a39aaa923fecb09f134f1bcba",
5555
strip_prefix = "libtorch",
56-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230605%2Bcu118.zip"],
56+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
5757
)
5858

5959
http_archive(
6060
name = "libtorch_pre_cxx11_abi",
6161
build_file = "@//third_party/libtorch:BUILD",
62-
sha256 = "786cc728c63ea69c40bd8fb535cf8e5e1dfff1d43eaad3eb5256b9ed89c1b268",
62+
sha256 = "8f6661bfc11597e77400e9e36cc8dd8e5e385ba82361d630d9ccede8518d7c7e",
6363
strip_prefix = "libtorch",
64-
urls = ["https://download.pytorch.org/libtorch/nightly/cu118/libtorch-shared-with-deps-2.1.0.dev20230605%2Bcu118.zip"],
64+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
6565
)
6666

6767
# Download these tarballs manually from the NVIDIA website
@@ -71,20 +71,20 @@ http_archive(
7171
http_archive(
7272
name = "cudnn",
7373
build_file = "@//third_party/cudnn/archive:BUILD",
74-
sha256 = "36fff137153ef73e6ee10bfb07f4381240a86fb9fb78ce372414b528cbab2293",
75-
strip_prefix = "cudnn-linux-x86_64-8.8.0.121_cuda11-archive",
74+
sha256 = "79d77a769c7e7175abc7b5c2ed5c494148c0618a864138722c887f95c623777c",
75+
strip_prefix = "cudnn-linux-x86_64-8.8.1.3_cuda12-archive",
7676
urls = [
77-
"https://developer.download.nvidia.com/compute/cudnn/secure/8.8.0/local_installers/11.8/cudnn-linux-x86_64-8.8.0.121_cuda11-archive.tar.xz",
77+
"https://developer.nvidia.com/downloads/compute/cudnn/secure/8.8.1/local_installers/12.0/cudnn-linux-x86_64-8.8.1.3_cuda12-archive.tar.xz",
7878
],
7979
)
8080

8181
http_archive(
8282
name = "tensorrt",
8383
build_file = "@//third_party/tensorrt/archive:BUILD",
84-
sha256 = "15bfe6053d45feec45ecc7123a9106076b0b43fa0435f242d89dca0778337759",
84+
sha256 = "0f8157a5fc5329943b338b893591373350afa90ca81239cdadd7580cd1eba254",
8585
strip_prefix = "TensorRT-8.6.1.6",
8686
urls = [
87-
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz",
87+
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz",
8888
],
8989
)
9090

docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Base image starts with CUDA
2-
ARG BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04
2+
ARG BASE_IMG=nvidia/cuda:12.1.1-devel-ubuntu22.04
33
FROM ${BASE_IMG} as base
4-
ENV BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04
4+
ENV BASE_IMG=nvidia/cuda:12.1.1-devel-ubuntu22.04
55

66
ARG TENSORRT_VERSION
77
ENV TENSORRT_VERSION=${TENSORRT_VERSION}

0 commit comments

Comments
 (0)