Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to cross-build Python wheels for Jetson #2313

Merged
merged 9 commits into from
Oct 16, 2020

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Sep 30, 2020

  • adds a way to build Python bindings when cross-compiling DALI for Xavier platform
  • adds a way to generate Python wheel for Xavier

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • It fixes a bug bug description
  • It adds new feature needed because of why we need this feature
  • Refactoring to improve what

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    [ Explain solution of the problem, a new feature added here. ]
  • Affected modules and functionalities:
    [ Describe here what was changed, added, removed. ]
  • Key points relevant for the review:
    [ Describe here what is the most important part that reviewers should focus on. ]
  • Validation and testing:
    [ Describe here if and how this PR is tested. ]
  • Documentation (including examples):
    [ Describe here if documentation and examples were updated. ]

JIRA TASK: [Use DALI-XXXX or NA]

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1666342]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1666342]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1666713]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1666713]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1668846]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1668846]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1668846]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1670025]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1670025]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1670833]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1670833]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1671885]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1671885]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672273]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672273]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672559]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672559]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1673199]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1673199]: BUILD FAILED

@JanuszL JanuszL force-pushed the jetson_whl branch 3 times, most recently from 9756884 to f90917e Compare October 5, 2020 20:50
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1678053]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1678053]: BUILD FAILED

@JanuszL JanuszL force-pushed the jetson_whl branch 3 times, most recently from 6c159b1 to ec8fdea Compare October 6, 2020 09:15
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1692667]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1692667]: BUILD FAILED

@JanuszL JanuszL force-pushed the jetson_whl branch 2 times, most recently from 1f8ef05 to 9ef2c3d Compare October 13, 2020 01:04
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1695978]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1695978]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1697321]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1697321]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1697321]: BUILD PASSED

@@ -59,11 +59,17 @@ cmake -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} \
-DBUILD_TEST=${BUILD_TEST:-ON} \
-DBUILD_DALI_KERNELS=${BUILD_DALI_KERNELS:-ON} \
Copy link
Contributor

@jantonguirao jantonguirao Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those are not options exposed to CMake. We should remove those three from here. Remove BUILD_DALI_KERNELS BUILD_DALI_PIPELINE BUILD_DALI_OPERATORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

docker/build.sh Outdated
@@ -136,11 +136,17 @@ if [ "$BUILD_INHOST" == "YES" ]; then
CUDA_TARGET_ARCHS=\"${CUDA_TARGET_ARCHS}\"\
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
BUILD_TEST=${BUILD_TEST} \
BUILD_DALI_KERNELS=${BUILD_DALI_KERNELS} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove BUILD_DALI_KERNELS BUILD_DALI_PIPELINE BUILD_DALI_OPERATORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

docker/build.sh Outdated
@@ -169,10 +175,16 @@ else
--build-arg "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" \
--build-arg "BUILD_TEST=${BUILD_TEST}" \
--build-arg "BUILD_BENCHMARK=${BUILD_BENCHMARK}" \
--build-arg "BUILD_DALI_KERNELS=${BUILD_DALI_KERNELS}" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove BUILD_DALI_KERNELS BUILD_DALI_PIPELINE BUILD_DALI_OPERATORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -25,12 +25,18 @@ shift $((OPTIND - 1))
export ARCH=${ARCH}
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
export BUILD_TEST=${BUILD_TEST:-ON}
export BUILD_DALI_KERNELS=${BUILD_DALI_KERNELS:-ON}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove BUILD_DALI_KERNELS BUILD_DALI_PIPELINE BUILD_DALI_OPERATORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -60,11 +68,17 @@ cmake ../ -DCMAKE_INSTALL_PREFIX=. \
-DCUDA_TARGET_ARCHS=${CUDA_TARGET_ARCHS} \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DBUILD_TEST=${BUILD_TEST} \
-DBUILD_DALI_KERNELS=${BUILD_DALI_KERNELS} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove BUILD_DALI_KERNELS BUILD_DALI_PIPELINE BUILD_DALI_OPERATORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

for exclude in "${EXCLUDE_PACKAGES[@]}"; do
grep -qiE ${exclude} ${test_script} && status=$((status+1))
done
# execute only when no machtes are found
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# execute only when no machtes are found
# execute only when no matches are found

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -44,6 +44,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

INWHL=$(readlink -e $1)
PATH_PREFIX=${2:-local}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PATH_PREFIX=${2:-local}
PATH_PREFIX=${2:-/usr/local}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a prefix it should be a prefix :)

Copy link
Contributor Author

@JanuszL JanuszL Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to DEPS_PATH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"libopenjp2.so.7"
"libzstd.so.1"
"libz.so.1"
"/usr/${PATH_PREFIX}/lib64/libjpeg.so.62"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"/usr/${PATH_PREFIX}/lib64/libjpeg.so.62"
"${PATH_PREFIX}/lib64/libjpeg.so.62"

Copy link
Contributor Author

@JanuszL JanuszL Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For jetson it is /usr/aarch64-linux-gnu/lib64/. I can change the name to DEPS_PATH.

export BUILD_BENCHMARK=${BUILD_BENCHMARK:-ON}
# use a default value as it differs for CUDA 9.x and CUDA 10.x
export BUILD_NVTX=${BUILD_NVTX}
export BUILD_PYTHON=${BUILD_PYTHON:-ON}
export BUILD_LMDB=${BUILD_LMDB:-ON}
export BUILD_JPEG_TURBO=${BUILD_JPEG_TURBO:-ON}
export BUILD_FFMPEG=${BUILD_FFMPEG:-ON}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove, BUILD_FFMPEG is an internal variable (BUILD_NVDEC is the exposed option)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

-DBUILD_BENCHMARK=${BUILD_BENCHMARK:-ON} \
-DBUILD_NVTX=${BUILD_NVTX} \
-DBUILD_PYTHON=${BUILD_PYTHON:-ON} \
-DBUILD_LMDB=${BUILD_LMDB:-ON} \
-DBUILD_JPEG_TURBO=${BUILD_JPEG_TURBO:-ON} \
-DBUILD_FFMPEG=${BUILD_FFMPEG:-ON} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove, BUILD_FFMPEG is an internal variable (BUILD_NVDEC is the exposed option)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

docker/build.sh Outdated
--build-arg "BUILD_NVTX=${BUILD_NVTX}" \
--build-arg "BUILD_PYTHON=${BUILD_PYTHON}" \
--build-arg "BUILD_LMDB=${BUILD_LMDB}" \
--build-arg "BUILD_JPEG_TURBO=${BUILD_JPEG_TURBO}" \
--build-arg "BUILD_FFMPEG=${BUILD_FFMPEG}" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove, BUILD_FFMPEG is an internal variable (BUILD_NVDEC is the exposed option)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- adds a way to build Python bindings when cross-compiling DALI
  for Xavier platform
- adds a way to generate Python wheel for Xavier

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1707811]: BUILD STARTED

@@ -44,6 +44,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

INWHL=$(readlink -e $1)
DEPS_PATH=${2:-local}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DEPS_PATH=${2:-local}
DEPS_PATH=${2:-/usr/local}

and adjust below

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1707907]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1707907]: BUILD PASSED

@JanuszL JanuszL merged commit 97152cd into NVIDIA:master Oct 16, 2020
@JanuszL JanuszL deleted the jetson_whl branch October 16, 2020 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants