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

GpuMat invalid argument #27

Open
BB142 opened this issue Jul 18, 2023 · 4 comments
Open

GpuMat invalid argument #27

BB142 opened this issue Jul 18, 2023 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@BB142
Copy link

BB142 commented Jul 18, 2023

Hey,

thanks a lot for the awesome examples.
I tried your cuda GpuMat examples and it is working fine.
Doing stuff with the GpuMat at the listener side is somehow impossible.
Functions like download, clone(), etc. yield an invalid argument error.
The gpu_mat is not empty.

Any idea how to access the data of the GpuMat at listener side?

@ZhenshengLee
Copy link
Owner

Doing stuff with the GpuMat at the listener side is somehow impossible.
Functions like download, clone(), etc. yield an invalid argument error.
The gpu_mat is not empty.

Thanks for your report! I have't test the post-process of GpuMat.
Could you help to reproduce this behavior?

  1. fork this repo, commit your test code, give the link here.
  2. give your running environment, ubuntu version? ros2 version? in this post.
  3. give your steps to reproduce the error in this post.
  4. give your errors, paste the output here.

Thanks! @BB142

@ZhenshengLee ZhenshengLee self-assigned this Jul 18, 2023
@ZhenshengLee ZhenshengLee added the bug Something isn't working label Jul 18, 2023
@ZhenshengLee ZhenshengLee added this to the doing milestone Jul 18, 2023
@BB142
Copy link
Author

BB142 commented Jul 19, 2023

Thanks for your fast response.

  1. https://github.com/BB142/ros2_shm_msgs
  2. Ubuntu 22.04 Ros Humble
  3. git clone https://github.com/BB142/ros2_shm_msgs (to ws src) & export GPUAC_COMPILE_WITH_CUDA=true & cd ws_root & colcon build
    source install/setup.bash
    terminal 1: ros2 run shm_msgs gmat_image_node
    terminal 2: ros2 run shm_msgs gmat_image_listener
  4. terminate called after throwing an instance of 'cv::Exception'
    what(): OpenCV(4.6.0) /home/roomba/opencv/modules/core/src/cuda/gpu_mat.cu:246: error: (-217:Gpu API call) invalid argument in function 'download'

This error happens when splitting the talker and listener in two seperate executor. With one executor everything works fine.
Is there a way to get those two nodes running in different executors?

@ZhenshengLee
Copy link
Owner

You can not simply use ros2 run because it will not able to find the image file.

m_input_cvimage->image = cv::imread("./res/img/1920_1080.jpg");

so, use this command to run the origional executable, to check if there is still output the error.

cd ./install/shm_msgs/lib/shm_msgs/
./gmat_image_node

@ZhenshengLee
Copy link
Owner

I will find some time to check your code in the fork. humble...BB142:ros2_shm_msgs:humble

Before this , I suggest you run the original code to test the new type adaption feature in humble.

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

2 participants