Skip to content

Commit

Permalink
Core library version 0.0.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
helenol committed Nov 17, 2022
1 parent 8e4c76e commit 10e6efa
Show file tree
Hide file tree
Showing 131 changed files with 5,872 additions and 670 deletions.
182 changes: 130 additions & 52 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,66 +1,144 @@
pipeline {
agent {
dockerfile {
label 'isaac-gpu'
reuseNode true
filename 'Dockerfile.deps'
args '-u root --gpus all -v /var/run/docker.sock:/var/run/docker.sock:rw'
}
}
agent none
triggers {
gitlab(triggerOnMergeRequest: true, branchFilterType: 'All')
}
stages {
stage('Compile') {
steps {
sh '''mkdir -p nvblox/build'''
sh '''mkdir -p nvblox/install'''
sh '''cd nvblox/build && cmake .. -DCMAKE_INSTALL_PREFIX=../install && make -j8 && make install'''
}
}
stage('Test') {
steps {
sh '''cd nvblox/build/tests && ctest -T test --no-compress-output'''
}
}
stage('Link Into External Project') {
steps {
dir("nvblox_lib_test") {
git credentialsId: 'vault-svc-ssh', url: 'ssh://[email protected]:12051/nvblox/nvblox_lib_test.git', branch: 'main'
stage("Compile & Test Multiplatform") {
parallel {
stage("x86") {
agent {
dockerfile {
label 'isaac-gpu'
reuseNode true
filename 'docker/Dockerfile.deps'
args '-u root --gpus all -v /var/run/docker.sock:/var/run/docker.sock:rw'
}
}
stages {
stage('Compile x86') {
steps {
sh '''mkdir -p nvblox/build'''
sh '''mkdir -p nvblox/install'''
sh '''cd nvblox/build && cmake .. -DCMAKE_INSTALL_PREFIX=../install && make clean && make -j8 && make install'''
}
}
stage('Test x86') {
steps {
sh '''cd nvblox/build/tests && ctest -T test --no-compress-output'''
}
}
stage('Link Into External Project x86') {
steps {
dir("nvblox_lib_test") {
git credentialsId: 'vault-svc-ssh', url: 'ssh://[email protected]:12051/nvblox/nvblox_lib_test.git', branch: 'main'
}
sh '''mkdir -p nvblox_lib_test/build'''
sh '''cd nvblox_lib_test/build && cmake .. -DNVBLOX_INSTALL_PATH=${WORKSPACE}/nvblox/install && make'''
sh '''cd nvblox_lib_test/build && ./min_example'''
}
}
stage("Cleanup x86") {
steps {
// Archive the CTest xml output
archiveArtifacts (
artifacts: 'nvblox/build/tests/Testing/**/*.xml',
fingerprint: true
)

// Process the CTest xml output with the xUnit plugin
xunit (
testTimeMargin: '3000',
thresholdMode: 1,
thresholds: [
skipped(failureThreshold: '0'),
failed(failureThreshold: '0')
],
tools: [CTest(
pattern: 'nvblox/build/tests/Testing/**/*.xml',
deleteOutputFiles: true,
failIfNotNew: false,
skipNoTestFiles: true,
stopProcessingIfError: true
)]
)

// Clear the source and build dirs before next run
cleanWs()
}
}
}
}
stage("Jetson 5.0.2") {
agent {
dockerfile {
label 'jetson-5.0.2'
reuseNode true
filename 'docker/Dockerfile.jetson_deps'
args '-u root --runtime nvidia --gpus all -v /var/run/docker.sock:/var/run/docker.sock:rw'
}
}
stages {
stage('Compile Jetson') {
steps {
sh '''mkdir -p nvblox/build'''
sh '''mkdir -p nvblox/install'''
sh '''cd nvblox/build && cmake .. -DCMAKE_INSTALL_PREFIX=../install && make clean && make -j8 && make install'''
}
}
stage('Test Jetson') {
steps {
sh '''cd nvblox/build/tests && ctest -T test --no-compress-output'''
}
}
stage('Link Into External Project Jetson') {
steps {
dir("nvblox_lib_test") {
git credentialsId: 'vault-svc-ssh', url: 'ssh://[email protected]:12051/nvblox/nvblox_lib_test.git', branch: 'main'
}
sh '''mkdir -p nvblox_lib_test/build'''
sh '''cd nvblox_lib_test/build && cmake .. -DNVBLOX_INSTALL_PATH=${WORKSPACE}/nvblox/install && make'''
sh '''cd nvblox_lib_test/build && ./min_example'''
}
}
stage("Cleanup Jetson") {
steps {
archiveArtifacts (
artifacts: 'nvblox/build/tests/Testing/**/*.xml',
fingerprint: true
)

// Process the CTest xml output with the xUnit plugin
xunit (
testTimeMargin: '3000',
thresholdMode: 1,
thresholds: [
skipped(failureThreshold: '0'),
failed(failureThreshold: '0')
],
tools: [CTest(
pattern: 'nvblox/build/tests/Testing/**/*.xml',
deleteOutputFiles: true,
failIfNotNew: false,
skipNoTestFiles: true,
stopProcessingIfError: true
)]
)

// Clear the source and build dirs before next run
cleanWs()
}
}
}
}
sh '''mkdir -p nvblox_lib_test/build'''
sh '''cd nvblox_lib_test/build && cmake .. -DNVBLOX_INSTALL_PATH=${WORKSPACE}/nvblox/install && make'''
sh '''cd nvblox_lib_test/build && ./min_example'''
}
}
}
post {
always {
// Archive the CTest xml output
archiveArtifacts (
artifacts: 'nvblox/build/tests/Testing/**/*.xml',
fingerprint: true
)

// Process the CTest xml output with the xUnit plugin
xunit (
testTimeMargin: '3000',
thresholdMode: 1,
thresholds: [
skipped(failureThreshold: '0'),
failed(failureThreshold: '0')
],
tools: [CTest(
pattern: 'nvblox/build/Testing/**/*.xml',
deleteOutputFiles: true,
failIfNotNew: false,
skipNoTestFiles: true,
stopProcessingIfError: true
)]
)

// Clear the source and build dirs before next run
cleanWs()
agent {
label 'isaac-gpu'
}
}
failure {
updateGitlabCommitStatus name: 'build', state: 'failed'
Expand Down
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# nvblox
Signed Distance Functions (SDFs) on NVIDIA GPUs.

<div align="left"><img src="docs/images/nvblox_logo.png" width=256px/></div>

An SDF library which offers
* Support for storage of various voxel types
* GPU accelerated agorithms such as:
* TSDF construction
* ESDF construction
* Meshing
* ROS2 interface (see [isaac_ros_nvblox](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nvblox))
* ~~Python bindings~~ (coming soon)

Expand All @@ -31,7 +34,7 @@ We depend on:
- gtest
- glog
- gflags (to run experiments)
- CUDA 10.2 - 11.5 (others might work but are untested)
- CUDA 11.0 - 11.6 (others might work but are untested)
- Eigen (no need to explicitly install, a recent version is built into the library)
- SQLite 3 (for serialization)
Please run
Expand Down Expand Up @@ -69,11 +72,13 @@ you should see a mesh of a room:

# Docker

We have several dockerfiles which layer on top of one another for the following purposes:
We have several dockerfiles (in the `docker` subfolder) which layer on top of one another for the following purposes:

* **Docker.deps**
* * This installs our dependencies.
* * This is used in our CI, where the later steps (building and testing) are taken care of by Jenkins (and not docker).
* **Docker.jetson_deps**
* * Same as above, just on the Jetson (Jetpack 5 and above).
* **Docker.build**
* * Layers on top of Docker.deps.
* * This builds our package.
Expand Down Expand Up @@ -101,13 +106,13 @@ Restart docker
```
sudo systemctl restart docker
```
Now Let's build Dockerfile.deps docker image. This image install contains our dependacies.
Now Let's build Dockerfile.deps docker image. This image install contains our dependencies. (In case you are running this on the Jetson, simply substitute docker/`Dockerfile.jetson_deps` below and the rest of the instructions remain the same.
```
docker build -t nvblox_deps -f Dockerfile.deps .
docker build -t nvblox_deps -f docker/Dockerfile.deps .
```
Now let's build the Dockerfile.build. This image layers on the last, and actually builds the nvblox library.
```
docker build -t nvblox -f Dockerfile.build .
docker build -t nvblox -f docker/Dockerfile.build .
```
Now let's run the 3DMatch example inside the docker. Note there's some additional complexity in the `docker run` command such that we can forward X11 to the host (we're going to be view a reconstruction in a GUI). Run the container using:
```
Expand All @@ -120,7 +125,7 @@ apt-get update
apt-get install unzip
wget http://vision.princeton.edu/projects/2016/3DMatch/downloads/rgbd-datasets/sun3d-mit_76_studyroom-76-1studyroom2.zip -P ~/datasets/3dmatch
unzip ~/datasets/3dmatch/sun3d-mit_76_studyroom-76-1studyroom2.zip -d ~/datasets/3dmatch
cd nvblox/nvblox/build/experiments/
cd nvblox/nvblox/build/executables/
./fuse_3dmatch ~/datasets/3dmatch/sun3d-mit_76_studyroom-76-1studyroom2/ --esdf_frame_subsampling 3000 --mesh_output_path mesh.ply
```
Now let's visualize. From the same experiments folder run:
Expand All @@ -131,7 +136,7 @@ python3 ../../visualization/visualize_mesh.py mesh.ply
```

# Additional instructions for Jetson Xavier
These instructions are for a native build on the Jetson Xavier. A Docker based build is coming soon.
These instructions are for a native build on the Jetson Xavier. You can see the instructions above for running in docker.

The instructions for the native build above work, with one exception:

Expand All @@ -156,5 +161,14 @@ sudo apt-get install cmake
export OPENBLAS_CORETYPE=ARMV8
```

# Building for multiple GPU architectures
By default, the library builds ONLY for the compute capability (CC) of the machine it's being built on. To build binaries that can be used across multiple machines (i.e., pre-built binaries for CI, for example), you can use the `BUILD_FOR_ALL_ARCHS` flag and set it to true. Example:
```
cmake .. -DBUILD_FOR_ALL_ARCHS=True -DCMAKE_INSTALL_PREFIX=../install/ && make -j8 && make install
```

# Building redistributable binaries, with static dependencies
If you want to include nvblox in another CMake project, simply `find_package(nvblox)` should bring in the correct libraries and headers. However, if you want to include it in a different build system such as Bazel, you can see the instructions here: [docs/redistibutable.md].

# License
This code is under an [open-source license](LICENSE) (Apache 2.0). :)
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions docker/Dockerfile.jetson_deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM nvcr.io/nvidia/l4t-jetpack:r35.1.0

# TZData goes first.
RUN apt-get update
ENV TZ Europe/Berlin
ENV DEBIAN_FRONTEND noninteractive
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get install -y tzdata

# Install basics.
RUN apt-get update
RUN apt-get install -y ssh git jq gnupg apt-utils software-properties-common build-essential cmake

# Install dependencies.
RUN apt-get install -y libgoogle-glog-dev libgtest-dev curl libsqlite3-dev

# Build gtest because gtest doesn't do this for you for some reason.
RUN cd /usr/src/googletest && cmake . && cmake --build . --target install

ENV DEBIAN_FRONTEND teletype
File renamed without changes.
Loading

0 comments on commit 10e6efa

Please sign in to comment.