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

Can't work in JESTON AGX ORIN #26

Open
1 task done
yeyiru opened this issue Jan 21, 2025 · 9 comments
Open
1 task done

Can't work in JESTON AGX ORIN #26

yeyiru opened this issue Jan 21, 2025 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@yeyiru
Copy link

yeyiru commented Jan 21, 2025

Version

0.4.0

Describe the bug.

I run the sample code in
But I got some error. I can see the first image, But I can't see the other. Could you give me some advice?

Minimum reproducible example

import os
import numpy as np
from matplotlib import pyplot as plt
from nvidia import nvimgcodec

resources_dir = './'
decoder = nvimgcodec.Decoder()
encoder = nvimgcodec.Encoder()

example_image = np.asarray(decoder.read(resources_dir + "cat-1046544_640.jp2").cpu())
plt.title(f"original image, size: {example_image.size // 1000}KB")
plt.imshow(example_image)
plt.show()

for extension in ["jpeg", "jpeg2k", "webp"]:
    if extension == "jpeg2k":
        # if Jpeg2kEncodeParams are ommited, reversible=False is assumed and target_psnr controls quality
        encode_params = nvimgcodec.EncodeParams(target_psnr=27)
    else:
        # Other codecs use quality
        encode_params = nvimgcodec.EncodeParams(quality=5)
    
    encoded = encoder.encode(example_image, extension, encode_params)
    decoded = np.asarray(decoder.decode(encoded).cpu())
    plt.title(f"codec: {extension}, size: {len(encoded) // 1000}KB")
    plt.imshow(decoded)
    plt.show()

Environment details

jeston AGX Orin
L4T 36.4.3

Relevant log output

[ERROR] [nvjpeg2k_decoder] Could not decode jpeg2k code stream - nvjpeg2k error #6 (execution failed) when running nvjpeg2kDecodeImage(handle_, jpeg2k_state, t.nvjpeg2k_stream_, decode_params_raii.get(), &output_image, image_info.cuda_stream) at /home/jenkins/agent/workspace/nvimagecodec/helpers/release_v0.4.0/Release_12/build/extensions/nvjpeg2k/cuda_decoder.cpp:650
[ERROR] [nvjpeg_cuda_encoder] Could not encode jpeg code stream - nvjpeg error #6 (execution failed) when running nvjpegEncodeImage(handle_, state, encode_params.get(), &input_image, input_format, image_info.plane_info[0].width, image_info.plane_info[0].height, image_info.cuda_stream) at /home/jenkins/agent/workspace/nvimagecodec/helpers/release_v0.4.0/Release_12/build/extensions/nvjpeg/cuda_encoder.cpp:425
Fatal Python error: Segmentation fault
Thread 0x0000ffffa938f120 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/threading.py", line 607 in wait
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 325 in _on_run
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py", line 53 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x0000ffffa9b9f120 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/threading.py", line 607 in wait
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 279 in _on_run
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py", line 53 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x0000ffffaa3af120 (most recent call first):
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 227 in _read_line
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 245 in _on_run
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py", line 53 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x0000ffffaabbf120 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/queue.py", line 180 in get
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 390 in _on_run
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py", line 53 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Current thread 0x0000ffffac441a60 (most recent call first):
  File "/data/DeltaElect/ubuntu2204/sensors_plat_ws/src/debug.py", line 23 in <module>
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 118 in _run_code
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 127 in _run_module_code
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 310 in run_path
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 351 in run_file
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 501 in main
  File "/root/.vscode-server/extensions/ms-python.debugpy-2024.14.0/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 71 in <module>
  File "/usr/lib/python3.10/runpy.py", line 86 in _run_code
  File "/usr/lib/python3.10/runpy.py", line 196 in _run_module_as_main

Other/Misc.

No response

Check for duplicates

  • I have searched the open bugs/issues and have found no duplicates for this bug report
@yeyiru yeyiru added the bug Something isn't working label Jan 21, 2025
@jantonguirao
Copy link
Collaborator

Thank you for your reporting this.
I'd like to ask, what nvjpeg2k version do you have installed? Can you share the output of

pip show nvidia-nvjpeg2k-tegra-cu12

?

@jantonguirao jantonguirao self-assigned this Jan 21, 2025
@yeyiru
Copy link
Author

yeyiru commented Jan 22, 2025

Thank you for your reporting this. I'd like to ask, what nvjpeg2k version do you have installed? Can you share the output of

pip show nvidia-nvjpeg2k-tegra-cu12

?

@jantonguirao Thank you for your help. I got this log:

Name: nvidia-nvjpeg2k-tegra-cu12
Version: 0.8.1.40
Summary: NVIDIA nvJPEG2000 native runtime libraries
Home-page: https://developer.nvidia.com/nvjpeg
Author: NVIDIA Corporation
Author-email: [email protected]
License: NVIDIA Proprietary Software
Location: /usr/local/lib/python3.10/dist-packages
Requires:
Required-by:

@yeyiru
Copy link
Author

yeyiru commented Jan 22, 2025

By the way, if I just run these codes:

import os
import cv2
import numpy as np
from matplotlib import pyplot as plt

from nvidia import nvimgcodec
decoder = nvimgcodec.Decoder()
encoder = nvimgcodec.Encoder()

with open("tabby_tiger_cat.jpg", 'rb') as in_file:
    data = in_file.read()
    nv_img_cat = decoder.decode(data)

I got the error:

[ERROR] [nvjpeg_cuda_decoder] Could not decode jpeg code stream - nvjpeg error #6 (execution failed) when running nvjpegDecodeJpegDevice(handle_, decoder, state, &nvjpeg_image, image_info.cuda_stream) at /home/jenkins/agent/workspace/nvimagecodec/helpers/release_v0.4.0/Release_12/build/extensions/nvjpeg/cuda_decoder.cpp:568

@jantonguirao
Copy link
Collaborator

Having errors both on nvjpeg and nvjpeg2k call perhaps suggests that there's something wrong with the CUDA environment.
Can you give us more details on your CUDA environment (driver version?).
You could also try this https://forums.developer.nvidia.com/t/cuda-runtime-on-jetson-orin-agx/260735/3

export PATH=/usr/local/cuda-12/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda-12.0/compat
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery

@yeyiru
Copy link
Author

yeyiru commented Jan 22, 2025

Having errors both on nvjpeg and nvjpeg2k call perhaps suggests that there's something wrong with the CUDA environment. Can you give us more details on your CUDA environment (driver version?). You could also try this https://forums.developer.nvidia.com/t/cuda-runtime-on-jetson-orin-agx/260735/3

export PATH=/usr/local/cuda-12/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda-12.0/compat
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery

This is my system environment!
Image

@jantonguirao
Copy link
Collaborator

Thank you. Are you able to run the deviceQuery program above?

@yeyiru
Copy link
Author

yeyiru commented Jan 22, 2025

Thank you. Are you able to run the deviceQuery program above?

I don't have this dir /usr/local/cuda/samples/1_Utilities/deviceQuery

cd /usr/local/cuda/samples/1_Utilities/deviceQuery
-bash: cd: /usr/local/cuda/samples/1_Utilities/deviceQuery: No such file or directory

In my cuda dir I have these file

bin compute-sanitizer doc DOCS EULA.txt extras gds include lib64 nvml nvvm README share targets tools version.json

@zohebk-nv
Copy link
Collaborator

Hi,
Please verify if nvjpeg is installed in your environment by running -
ls /usr/local/cuda-12.6/lib64
and checking if libnvjpeg.so is present

If you dont see libnvjpeg.so, you can install it by running these commands -

sudo apt update
sudo apt install libnvjpeg-dev-12-6

@giapvn
Copy link

giapvn commented Feb 18, 2025

Relevant log output

[ERROR] [nvjpeg2k_decoder] Could not decode jpeg2k code stream - nvjpeg2k error #6 (execution failed) when running nvjpeg2kDecodeImage(handle_, jpeg2k_state, t.nvjpeg2k_stream_, decode_params_raii.get(), &output_image, image_info.cuda_stream) at /home/jenkins/agent/workspace/nvimagecodec/helpers/release_v0.4.0/Release_12/build/extensions/nvjpeg2k/cuda_decoder.cpp:650
[ERROR] [nvjpeg_cuda_encoder] Could not encode jpeg code stream - nvjpeg error #6 (execution failed) when running nvjpegEncodeImage(handle_, state, encode_params.get(), &input_image, input_format, image_info.plane_info[0].width, image_info.plane_info[0].height, image_info.cuda_stream) at /home/jenkins/agent/workspace/nvimagecodec/helpers/release_v0.4.0/Release_12/build/extensions/nvjpeg/cuda_encoder.cpp:425

I met the same error message when I ran examples on C++ on Jetson AGX Orin while I had all encoder/decoder libs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants