@@ -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,30 @@ 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
+ export PATH=$PATH:/usr/local/cuda/bin
297
+ ~/cmake/bin/cmake -S. -Bbuild \
298
+ -DCMAKE_MODULE_PATH=cmake/Module \
299
+ -DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
300
+ -DTensorRT_ROOT=/usr \
301
+ -DCMAKE_BUILD_TYPE=Debug
302
+ cmake --build build -j4
303
+ mkdir -p /tmp/dist/builds
304
+ cp -r build/bin /tmp/dist/builds
305
+ cp -r build/lib /tmp/dist/builds
306
+ cp -r cpp/include /tmp/dist/builds
307
+
308
+
210
309
dump-test-env :
211
310
description : " Dump the test env to console"
212
311
steps :
@@ -632,7 +731,7 @@ jobs:
632
731
platform : " x86_64"
633
732
cudnn-version : << pipeline.parameters.cudnn-release-version >>
634
733
trt-version-short : << pipeline.parameters.trt-release-version-short >>
635
- bazel-version : " 5.1.1 "
734
+ bazel-version : << pipeline.parameters.bazel-version >>
636
735
bazel-platform : " x86_64"
637
736
- run :
638
737
name : Build cxx11-abi tarball
@@ -703,7 +802,7 @@ jobs:
703
802
platform : " sbsa"
704
803
cudnn-version : << pipeline.parameters.cudnn-jetson-version >>
705
804
trt-version-short : << pipeline.parameters.trt-jetson-version-short >>
706
- bazel-version : " 5.1.1 "
805
+ bazel-version : << pipeline.parameters.bazel-version >>
707
806
bazel-platform : " arm64"
708
807
- run :
709
808
name : Set python version
@@ -742,6 +841,45 @@ jobs:
742
841
path : /tmp/dist/jetson
743
842
destination : aarch64-release-pkgs
744
843
844
+ build-x86_64-cmake :
845
+ parameters :
846
+ cudnn-version :
847
+ type : string
848
+ trt-version-short :
849
+ type : string
850
+ torch-build :
851
+ type : string
852
+ torch-build-index :
853
+ type : string
854
+ machine :
855
+ image : ubuntu-2004-cuda-11.4:202110-01
856
+ resource_class : gpu.nvidia.small
857
+ steps :
858
+ - checkout
859
+ - create-env :
860
+ os : " ubuntu2004"
861
+ platform : " x86_64"
862
+ cudnn-version : << parameters.cudnn-version >>
863
+ trt-version-short : << parameters.trt-version-short >>
864
+ bazel-platform : " x86_64"
865
+ - install-cmake :
866
+ version : 3.24.1
867
+ - install-torch-from-index :
868
+ torch-build : << parameters.torch-build >>
869
+ torch-build-index : << parameters.torch-build-index >>
870
+ - build-cmake
871
+ - run :
872
+ name : Move to cmake build dir
873
+ command : |
874
+ mkdir -p /tmp/dist/cmake
875
+ cp -r /tmp/dist/builds/* /tmp/dist/cmake
876
+ - persist_to_workspace :
877
+ root : /tmp/dist
878
+ paths :
879
+ - cmake
880
+ - store_artifacts :
881
+ path : /tmp/dist/cmake
882
+ destination : x86_64-cmake
745
883
746
884
parameters :
747
885
bazel-version :
@@ -821,7 +959,6 @@ workflows:
821
959
jetpack-version : << pipeline.parameters.jetpack-version >>
822
960
python-version : 3.8.10
823
961
824
-
825
962
- build-x86_64-pyt-release :
826
963
torch-build : << pipeline.parameters.torch-release-build >>
827
964
torch-build-index : << pipeline.parameters.torch-release-build-index >>
@@ -855,7 +992,6 @@ workflows:
855
992
requires :
856
993
- build-x86_64-pyt-release
857
994
858
-
859
995
- build-x86_64-pyt-nightly :
860
996
torch-build : << pipeline.parameters.torch-nightly-build >>
861
997
torch-build-index : << pipeline.parameters.torch-nightly-build-index >>
@@ -901,7 +1037,6 @@ workflows:
901
1037
torch-build : << pipeline.parameters.torch-release-build >>
902
1038
torch-build-index : << pipeline.parameters.torch-release-build-index >>
903
1039
904
-
905
1040
- test-core-cpp-x86_64 :
906
1041
name : test-core-cpp-x86_64-pyt-release
907
1042
channel : " release"
@@ -958,7 +1093,6 @@ workflows:
958
1093
jetpack-version : << pipeline.parameters.jetpack-version >>
959
1094
python-version : 3.8.10
960
1095
961
-
962
1096
- build-x86_64-pyt-release :
963
1097
torch-build : << pipeline.parameters.torch-release-build >>
964
1098
torch-build-index : << pipeline.parameters.torch-release-build-index >>
@@ -1025,3 +1159,17 @@ workflows:
1025
1159
trt-version-long : << pipeline.parameters.trt-nightly-version-long >>
1026
1160
requires :
1027
1161
- build-x86_64-pyt-nightly
1162
+
1163
+ - build-x86_64-cmake :
1164
+ name : build-x86_64-cmake-pyt-nightly
1165
+ torch-build : << pipeline.parameters.torch-nightly-build >>
1166
+ torch-build-index : << pipeline.parameters.torch-nightly-build-index >>
1167
+ trt-version-short : << pipeline.parameters.trt-nightly-version-short >>
1168
+ cudnn-version : << pipeline.parameters.cudnn-nightly-version >>
1169
+
1170
+ - build-x86_64-cmake :
1171
+ name : build-x86_64-cmake-pyt-release
1172
+ torch-build : << pipeline.parameters.torch-release-build >>
1173
+ torch-build-index : << pipeline.parameters.torch-release-build-index >>
1174
+ trt-version-short : << pipeline.parameters.trt-release-version-short >>
1175
+ cudnn-version : << pipeline.parameters.cudnn-release-version >>
0 commit comments