@@ -19,6 +19,81 @@ commands:
19
19
sudo wget -q https://github.com/bazelbuild/bazel/releases/download/<< parameters.version >>/bazel-<< parameters.version >>-linux-<< parameters.platform >> -O /usr/bin/bazel
20
20
sudo chmod a+x /usr/bin/bazel
21
21
22
+ install-cmake :
23
+ description : Install CMake.
24
+ parameters :
25
+ cache :
26
+ default : true
27
+ description : Whether or not to cache the installation.
28
+ type : boolean
29
+ cache-key :
30
+ default : v1
31
+ description : String to use in cache key. Typically overridden when needed to bust cache.
32
+ type : string
33
+ install-dir :
34
+ default : $HOME/cmake
35
+ description : The path to install CMake to.
36
+ type : string
37
+ version :
38
+ default : 3.18.2
39
+ description : The version of CMake to install.
40
+ type : string
41
+ steps :
42
+ - when :
43
+ condition :
44
+ equal :
45
+ - << parameters.cache >>
46
+ - true
47
+ steps :
48
+ - run :
49
+ command : mkdir -pv << parameters.install-dir >>
50
+ name : Prep cache restore
51
+ - restore_cache :
52
+ keys :
53
+ - cmake-<< parameters.cache-key >>-<< parameters.version >>
54
+ - run :
55
+ command : |
56
+ echo 'export PATH="<< parameters.install-dir >>/bin:$PATH"' >> $BASH_ENV
57
+ name : Add CMake to PATH
58
+ - run :
59
+ command : |
60
+ if which cmake; then
61
+ if cmake --version | grep "<< parameters.version >>"; then
62
+ echo "CMake is already installed."
63
+ exit 0
64
+ else
65
+ echo "CMake is already installed but it is the wrong version."
66
+ fi
67
+ fi
68
+
69
+ rm -rf << parameters.install-dir >>/*
70
+ echo "Installing the requested version of CMake."
71
+ baseUrl="https://github.com/Kitware/CMake/releases/download/"
72
+ url="${baseUrl}/v<< parameters.version >>/cmake-<< parameters.version >>-Linux-x86_64.tar.gz"
73
+ curl -sSL -o /tmp/cmake.tar.gz $url
74
+ tar -C << parameters.install-dir >> --strip-components 1 -zxf /tmp/cmake.tar.gz
75
+ name : Install CMake
76
+ - run :
77
+ command : rm -rf << parameters.install-dir >>/{doc,man}
78
+ name : Remove unnecessary files
79
+ - run :
80
+ command : |
81
+ ls -l << parameters.install-dir >>/bin
82
+ echo $PATH
83
+ cmake --version
84
+ name : Verify CMake installation
85
+ - when :
86
+ condition :
87
+ equal :
88
+ - << parameters.cache >>
89
+ - true
90
+ steps :
91
+ - save_cache :
92
+ key : cmake-<< parameters.cache-key >>-<< parameters.version >>
93
+ paths :
94
+ - << parameters.install-dir >>
95
+
96
+
22
97
install-cuda :
23
98
description : " Install CUDA"
24
99
parameters :
@@ -207,6 +282,26 @@ commands:
207
282
mkdir -p /tmp/dist/builds
208
283
cp dist/* /tmp/dist/builds
209
284
285
+ build-cmake :
286
+ description : " Build the torch-tensorrt using CMake"
287
+ parameters :
288
+ platform :
289
+ type : string
290
+ default : " x86_64"
291
+ steps :
292
+ - run :
293
+ name : Build torch-tensorrt library with CMake
294
+ command : |
295
+ mkdir build
296
+ cmake -S. -Bbuild \
297
+ -DCMAKE_MODULE_PATH=cmake/Module \
298
+ -DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
299
+ -DTensorRT_ROOT=/usr \
300
+ -DCMAKE_BUILD_TYPE=Debug
301
+ cmake --build build
302
+ mkdir -p /tmp/dist/builds
303
+ cp -r build /tmp/dist/builds
304
+
210
305
dump-test-env :
211
306
description : " Dump the test env to console"
212
307
steps :
@@ -632,7 +727,7 @@ jobs:
632
727
platform : " x86_64"
633
728
cudnn-version : << pipeline.parameters.cudnn-release-version >>
634
729
trt-version-short : << pipeline.parameters.trt-release-version-short >>
635
- bazel-version : " 5.1.1 "
730
+ bazel-version : << pipeline.parameters.bazel-version >>
636
731
bazel-platform : " x86_64"
637
732
- run :
638
733
name : Build cxx11-abi tarball
@@ -703,7 +798,7 @@ jobs:
703
798
platform : " sbsa"
704
799
cudnn-version : << pipeline.parameters.cudnn-jetson-version >>
705
800
trt-version-short : << pipeline.parameters.trt-jetson-version-short >>
706
- bazel-version : " 5.1.1 "
801
+ bazel-version : << pipeline.parameters.bazel-version >>
707
802
bazel-platform : " arm64"
708
803
- run :
709
804
name : Set python version
@@ -742,6 +837,45 @@ jobs:
742
837
path : /tmp/dist/jetson
743
838
destination : aarch64-release-pkgs
744
839
840
+ build-x86_64-cmake :
841
+ parameters :
842
+ cudnn-version :
843
+ type : string
844
+ trt-version-short :
845
+ type : string
846
+ torch-build :
847
+ type : string
848
+ torch-build-index :
849
+ type : string
850
+ machine :
851
+ image : ubuntu-2004-cuda-11.4:202110-01
852
+ resource_class : xlarge
853
+ steps :
854
+ - checkout
855
+ - create-env :
856
+ os : " ubuntu2004"
857
+ platform : " x86_64"
858
+ cudnn-version : << parameters.cudnn-version >>
859
+ trt-version-short : << parameters.trt-version-short >>
860
+ bazel-platform : " x86_64"
861
+ - install-cmake :
862
+ version : 3.24.1
863
+ - install-torch-from-index :
864
+ torch-build : << parameters.torch-build >>
865
+ torch-build-index : << parameters.torch-build-index >>
866
+ - build-cmake
867
+ - run :
868
+ name : Move to cmake build dir
869
+ command : |
870
+ mkdir -p /tmp/dist/cmake
871
+ cp -r /tmp/dist/builds/* /tmp/dist/cmake
872
+ - persist_to_workspace :
873
+ root : /tmp/dist
874
+ paths :
875
+ - cmake
876
+ - store_artifacts :
877
+ path : /tmp/dist/cmake
878
+ destination : x86_64-cmake
745
879
746
880
parameters :
747
881
bazel-version :
@@ -821,7 +955,6 @@ workflows:
821
955
jetpack-version : << pipeline.parameters.jetpack-version >>
822
956
python-version : 3.8.10
823
957
824
-
825
958
- build-x86_64-pyt-release :
826
959
torch-build : << pipeline.parameters.torch-release-build >>
827
960
torch-build-index : << pipeline.parameters.torch-release-build-index >>
@@ -855,7 +988,6 @@ workflows:
855
988
requires :
856
989
- build-x86_64-pyt-release
857
990
858
-
859
991
- build-x86_64-pyt-nightly :
860
992
torch-build : << pipeline.parameters.torch-nightly-build >>
861
993
torch-build-index : << pipeline.parameters.torch-nightly-build-index >>
@@ -901,7 +1033,6 @@ workflows:
901
1033
torch-build : << pipeline.parameters.torch-release-build >>
902
1034
torch-build-index : << pipeline.parameters.torch-release-build-index >>
903
1035
904
-
905
1036
- test-core-cpp-x86_64 :
906
1037
name : test-core-cpp-x86_64-pyt-release
907
1038
channel : " release"
@@ -958,7 +1089,6 @@ workflows:
958
1089
jetpack-version : << pipeline.parameters.jetpack-version >>
959
1090
python-version : 3.8.10
960
1091
961
-
962
1092
- build-x86_64-pyt-release :
963
1093
torch-build : << pipeline.parameters.torch-release-build >>
964
1094
torch-build-index : << pipeline.parameters.torch-release-build-index >>
@@ -1025,3 +1155,17 @@ workflows:
1025
1155
trt-version-long : << pipeline.parameters.trt-nightly-version-long >>
1026
1156
requires :
1027
1157
- build-x86_64-pyt-nightly
1158
+
1159
+ - build-x86_64-cmake :
1160
+ name : build-x86_64-cmake-pyt-nightly
1161
+ torch-build : << pipeline.parameters.torch-nightly-build >>
1162
+ torch-build-index : << pipeline.parameters.torch-nightly-build-index >>
1163
+ trt-version-short : << pipeline.parameters.trt-nightly-version-short >>
1164
+ cudnn-version : << pipeline.parameters.cudnn-nightly-version >>
1165
+
1166
+ - build-x86_64-cmake :
1167
+ name : build-x86_64-cmake-pyt-release
1168
+ torch-build : << pipeline.parameters.torch-release-build >>
1169
+ torch-build-index : << pipeline.parameters.torch-release-build-index >>
1170
+ trt-version-short : << pipeline.parameters.trt-release-version-short >>
1171
+ cudnn-version : << pipeline.parameters.cudnn-release-version >>
0 commit comments