Skip to content

Commit 5afd028

Browse files
committed
chore: Adding CMake to the CI
1 parent 4d32d47 commit 5afd028

File tree

1 file changed

+78
-6
lines changed

1 file changed

+78
-6
lines changed

.circleci/config.yml

+78-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# See: https://circleci.com/docs/2.0/configuration-reference
33
version: 2.1
44

5+
orbs:
6+
cmake: sensu/[email protected]
7+
58
commands:
69
install-bazel:
710
description: "Install bazel"
@@ -207,6 +210,26 @@ commands:
207210
mkdir -p /tmp/dist/builds
208211
cp dist/* /tmp/dist/builds
209212
213+
build-cmake:
214+
description: "Build the torch-tensorrt using CMake"
215+
parameters:
216+
platform:
217+
type: string
218+
default: "x86_64"
219+
steps:
220+
- run:
221+
name: Build torch-tensorrt library with CMake
222+
command: |
223+
mkdir build
224+
cmake -S. -Bbuild \
225+
-DCMAKE_MODULE_PATH=cmake/Module \
226+
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
227+
-DTensorRT_ROOT=/usr \
228+
-DCMAKE_BUILD_TYPE=Debug
229+
cmake --build build
230+
mkdir -p /tmp/dist/builds
231+
cp -r build /tmp/dist/builds
232+
210233
dump-test-env:
211234
description: "Dump the test env to console"
212235
steps:
@@ -632,7 +655,7 @@ jobs:
632655
platform: "x86_64"
633656
cudnn-version: << pipeline.parameters.cudnn-release-version >>
634657
trt-version-short: << pipeline.parameters.trt-release-version-short >>
635-
bazel-version: "5.1.1"
658+
bazel-version: << pipeline.parameters.bazel-version >>
636659
bazel-platform: "x86_64"
637660
- run:
638661
name: Build cxx11-abi tarball
@@ -703,7 +726,7 @@ jobs:
703726
platform: "sbsa"
704727
cudnn-version: << pipeline.parameters.cudnn-jetson-version >>
705728
trt-version-short: << pipeline.parameters.trt-jetson-version-short >>
706-
bazel-version: "5.1.1"
729+
bazel-version: << pipeline.parameters.bazel-version >>
707730
bazel-platform: "arm64"
708731
- run:
709732
name: Set python version
@@ -742,6 +765,45 @@ jobs:
742765
path: /tmp/dist/jetson
743766
destination: aarch64-release-pkgs
744767

768+
build-x86_64-cmake:
769+
parameters:
770+
cudnn-version:
771+
type: string
772+
trt-version-short:
773+
type: string
774+
torch-build:
775+
type: string
776+
torch-build-index:
777+
type: string
778+
machine:
779+
image: ubuntu-2004-cuda-11.4:202110-01
780+
resource_class: xlarge
781+
steps:
782+
- checkout
783+
- create-env:
784+
os: "ubuntu2004"
785+
platform: "x86_64"
786+
cudnn-version: << parameters.cudnn-version >>
787+
trt-version-short: << parameters.trt-version-short >>
788+
bazel-platform: "x86_64"
789+
- cmake/install:
790+
version: 3.24.1
791+
- install-torch-from-index:
792+
torch-build: << parameters.torch-build >>
793+
torch-build-index: << parameters.torch-build-index >>
794+
- build-cmake
795+
- run:
796+
name: Move to cmake build dir
797+
command: |
798+
mkdir -p /tmp/dist/cmake
799+
cp -r /tmp/dist/builds/* /tmp/dist/cmake
800+
- persist_to_workspace:
801+
root: /tmp/dist
802+
paths:
803+
- cmake
804+
- store_artifacts:
805+
path: /tmp/dist/cmake
806+
destination: x86_64-cmake
745807

746808
parameters:
747809
bazel-version:
@@ -821,7 +883,6 @@ workflows:
821883
jetpack-version: << pipeline.parameters.jetpack-version >>
822884
python-version: 3.8.10
823885

824-
825886
- build-x86_64-pyt-release:
826887
torch-build: << pipeline.parameters.torch-release-build >>
827888
torch-build-index: << pipeline.parameters.torch-release-build-index >>
@@ -855,7 +916,6 @@ workflows:
855916
requires:
856917
- build-x86_64-pyt-release
857918

858-
859919
- build-x86_64-pyt-nightly:
860920
torch-build: << pipeline.parameters.torch-nightly-build >>
861921
torch-build-index: << pipeline.parameters.torch-nightly-build-index >>
@@ -901,7 +961,6 @@ workflows:
901961
torch-build: << pipeline.parameters.torch-release-build >>
902962
torch-build-index: << pipeline.parameters.torch-release-build-index >>
903963

904-
905964
- test-core-cpp-x86_64:
906965
name: test-core-cpp-x86_64-pyt-release
907966
channel: "release"
@@ -958,7 +1017,6 @@ workflows:
9581017
jetpack-version: << pipeline.parameters.jetpack-version >>
9591018
python-version: 3.8.10
9601019

961-
9621020
- build-x86_64-pyt-release:
9631021
torch-build: << pipeline.parameters.torch-release-build >>
9641022
torch-build-index: << pipeline.parameters.torch-release-build-index >>
@@ -1025,3 +1083,17 @@ workflows:
10251083
trt-version-long: << pipeline.parameters.trt-nightly-version-long >>
10261084
requires:
10271085
- build-x86_64-pyt-nightly
1086+
1087+
- build-x86_64-cmake:
1088+
name: build-x86_64-cmake-pyt-nightly
1089+
torch-build: << pipeline.parameters.torch-nightly-build >>
1090+
torch-build-index: << pipeline.parameters.torch-nightly-build-index >>
1091+
trt-version-short: << pipeline.parameters.trt-nightly-version-short >>
1092+
cudnn-version: << pipeline.parameters.cudnn-nightly-version >>
1093+
1094+
- build-x86_64-cmake:
1095+
name: build-x86_64-cmake-pyt-release
1096+
torch-build: << pipeline.parameters.torch-release-build >>
1097+
torch-build-index: << pipeline.parameters.torch-release-build-index >>
1098+
trt-version-short: << pipeline.parameters.trt-release-version-short >>
1099+
cudnn-version: << pipeline.parameters.cudnn-release-version >>

0 commit comments

Comments
 (0)