C++ API works wrong with decode dependencies although process of building from sources is full and successful
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cmake, cpp, docker
調査の方向性
example/nvimtrans と external/build_deps.sh、特に 39 行目から始め、続いて libtiff のビルドと C++ API に使用されている CMake 構成を調べます。提供されたコマンドでサポートされていない形式のエラーを再現し、依存関係のビルドで発生するリンカーエラーと比較します。依存関係がスクリプトを手動で編集せずにビルドでき、example が JPEG を正常に処理できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
v0.4.1
Describe the bug.
After I built successfully C++ API on Jetson AGX Orin (Jetpack 6.0) when I run the example by the command-line:
./example/nvimtrans/nvimtrans -i ../example/assets/images/tabby_tiger_cat.jpg -o /app/test.jpg -v 5
I have received the error message as below:
nvImageCodec version: 0.4.1
- extension API version: 0.4.0
- CUDA Runtime version: 12.2
Using GPU: Orin with Compute Capability 8.7
[INFO] [nvimgcodec] Registering extension nvimgcodec_builtin_parsers version:0.4.1
[INFO] [nvimgcodec] Framework is registering parser (id:bmp_parser codec:bmp)
[INFO] [nvimgcodec] Codec bmp not yet registered, registering for first time
[INFO] [nvimgcodec] Framework is registering parser (id:jpeg_parser codec:jpeg)
[INFO] [nvimgcodec] Codec jpeg not yet registered, registering for first time
[INFO] [nvimgcodec] Framework is registering parser (id:jpeg2k_parser codec:jpeg2k)
[INFO] [nvimgcodec] Codec jpeg2k not yet registered, registering for first time
[INFO] [nvimgcodec] Framework is registering parser (id:png_parser codec:png)
[INFO] [nvimgcodec] Codec png not yet registered, registering for first time
[INFO] [nvimgcodec] Framework is registering parser (id:pnm_parser codec:pnm)
[INFO] [nvimgcodec] Codec pnm not yet registered, registering for first time
[INFO] [nvimgcodec] Framework is registering parser (id:tiff_parser codec:tiff)
[INFO] [nvimgcodec] Codec tiff not yet registered, registering for first time
[INFO] [nvimgcodec] Framework is registering parser (id:webp_parser codec:webp)
[INFO] [nvimgcodec] Codec webp not yet registered, registering for first time
Loading /app/nvImageCodec/build/./example/nvimtrans/../example/assets/images/tabby_tiger_cat.jpg file
Error: Unsupported file format
[INFO] [nvimgcodec] Unregistering extension nvimgcodec_builtin_parsers version:0.4.1
[INFO] [nvimgcodec] Framework is unregistering parser (id:bmp_parser codec:bmp)
[INFO] [nvimgcodec] Framework is unregistering parser (id:jpeg_parser codec:jpeg)
[INFO] [nvimgcodec] Framework is unregistering parser (id:jpeg2k_parser codec:jpeg2k)
[INFO] [nvimgcodec] Framework is unregistering parser (id:png_parser codec:png)
[INFO] [nvimgcodec] Framework is unregistering parser (id:pnm_parser codec:pnm)
[INFO] [nvimgcodec] Framework is unregistering parser (id:tiff_parser codec:tiff)
[INFO] [nvimgcodec] Framework is unregistering parser (id:webp_parser codec:webp)
While I checked extensions, it had fully all above dependencies. The following is a trace of my build and installation.
Firstly, I built a docker image using Dockerfile below:
ARG BASE_IMAGE=nvcr.io/nvidia/deepstream:7.0-triton-multiarch
FROM ${BASE_IMAGE}
ENV DEBIAN_FRONTEND=noninteractive
ARG LIB_PREFIX=/usr/local/
ARG CMAKE_VERSION=3.24.3
ENV PATH="/usr/local/cuda-12.2/bin:${PATH}"
ENV LD_LIBRARY_PATH="${LIB_PREFIX}/lib/:/usr/lib/aarch64-linux-gnu/tegra/:${LD_LIBRARY_PATH}"
RUN rm /etc/apt/sources.list.d/cuda.list || true
RUN apt update && \
apt install -y python3-clang python3-pip wget git && \
apt install -y --no-install-recommends python3-pytest
WORKDIR /tmp
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz && \
tar xvf cmake-${CMAKE_VERSION}.tar.gz && \
cd cmake-${CMAKE_VERSION} && \
./bootstrap --parallel=4 && \
make -j$(nproc) && make install && ldconfig && \
cd .. && rm -f cmake-${CMAKE_VERSION}.tar.gz && rm -rf cmake-${CMAKE_VERSION}
RUN wget https://github.com/CVCUDA/CV-CUDA/releases/download/v0.13.0-beta/cvcuda-lib-0.13.0_beta-cuda12-aarch64-linux.tar.xz && \
wget https://github.com/CVCUDA/CV-CUDA/releases/download/v0.13.0-beta/cvcuda-dev-0.13.0_beta-cuda12-aarch64-linux.tar.xz && \
apt install -y ./cvcuda-lib-0.13.0_beta-cuda12-aarch64-linux.deb ./cvcuda-dev-0.13.0_beta-cuda12-aarch64-linux.deb && \
rm cvcuda-*
RUN wget https://github.com/NixOS/patchelf/releases/download/0.17.2/patchelf-0.17.2.tar.gz && \
tar -xvzf patchelf-0.17.2.tar.gz && \
cd patchelf-0.17.2 && \
./configure --prefix=/usr/local/ --docdir=/usr/share/doc/patchelf-0.17.2 && \
make -j$(nproc) && make install && ldconfig && \
cd .. && rm -rf patchelf-0.17.2*
RUN python3 -m pip install sphinx==5.0.0 sphinx_rtd_theme breathe future setuptools wheel clang==14.0 flake8 && \
python3 -m pip install libclang==14.0.1
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all
RUN apt --fix-broken install
WORKDIR /app
In the container based from the above image, I set up nvImageCodec C++ API as following:
git clone https://github.com/NVIDIA/nvImageCodec.git && \
cd nvImageCodec && \
git checkout v0.4.1 && git switch -c v0.4.1 && \
git submodule update --init --recursive --depth 1 && \
cd external/libtiff/build/ && \
cmake .. && make -j$(nproc) && make install
Because when I directly executed ./build_deps.sh to install libtiff that made error when I build the API:
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMASetupEncode':
tif_lzma.c:(.text+0xb4): undefined reference to `lzma_end'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMASetupDecode':
tif_lzma.c:(.text+0x104): undefined reference to `lzma_end'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMACleanup':
tif_lzma.c:(.text+0x170): undefined reference to `lzma_end'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMAVSetField':
tif_lzma.c:(.text+0x1fc): undefined reference to `lzma_lzma_preset'
/usr/bin/ld: tif_lzma.c:(.text+0x238): undefined reference to `lzma_stream_encoder'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMAEncode':
tif_lzma.c:(.text+0x384): undefined reference to `lzma_code'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMAPostEncode':
tif_lzma.c:(.text+0x564): undefined reference to `lzma_code'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMAPreDecode':
tif_lzma.c:(.text+0x6e0): undefined reference to `lzma_stream_decoder'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMAPreEncode':
tif_lzma.c:(.text+0x864): undefined reference to `lzma_stream_encoder'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `LZMADecode':
tif_lzma.c:(.text+0x9ec): undefined reference to `lzma_code'
/usr/bin/ld: tif_lzma.c:(.text+0xa04): undefined reference to `lzma_memusage'
/usr/bin/ld: tif_lzma.c:(.text+0xa14): undefined reference to `lzma_stream_decoder'
/usr/bin/ld: /usr/local/lib/libtiff.a(tif_lzma.c.o): in function `TIFFInitLZMA':
tif_lzma.c:(.text+0xd98): undefined reference to `lzma_lzma_preset'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/nvimgcodec_tests.dir/build.make:693: test/nvimgcodec_tests] Error 1
make[1]: *** [CMakeFiles/Makefile2:1002: test/CMakeFiles/nvimgcodec_tests.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
This issue will be fixed if I build it from source in the repo and then comment line 39 in the build_deps.sh file.
cd ../../../ && ./external/build_deps.sh && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
cmake --install . --config Release --prefix /opt/nvidia/nvimgcodec_cuda12
Please help me correct my processing if it is wrong, or help me debug this issue.
Thanks all in advance.
Minimum reproducible example
Environment details
Relevant log output
Other/Misc.
No response
Check for duplicates
- I have searched the open bugs/issues and have found no duplicates for this bug report
- 主要言語
- Jupyter Notebook
- スター
- 164
- フォーク
- 26
- 平均マージ
- 27分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/nvImageCodec のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
NVIDIA/nvImageCodec#65 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
NVIDIA/nvImageCodec#66 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
NVIDIA/nvImageCodec#64 ·
-
nvjpeg2k error 3 (Bad jpeg) on valid JPEG 2000 aerial photos that OpenJPEG and ffmpeg decode identically対応中かも @mkepa-nv が 5 日前に担当しました。 オープンbug
NVIDIA/nvImageCodec#63 · コメント 2 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
NVIDIA/nvImageCodec#60 ·
NVIDIA/nvImageCodec の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
S3: friction & debt ws:tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
MedakaLang/medaka#5247 ·
メンテナーはふだん 1 日以内に返信
-
ca-certificates_data-with-certs slice does not have newline at the end in /etc/ca-certificates.confオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
canonical/chisel-releases#1510 ·
メンテナーはふだん 2 日以内に返信
-
maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
assistant-ui/assistant-ui#10496 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
bmad-code-org/bmad-builder#127 ·