ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

How to enable gpu acceleration on laptop for ros? [closed]

asked 2022-06-24 03:47:14 -0500

Saurabh Rahatekar gravatar image

I m trying to simulate Intel Realsense camera on Asus Tuf A15 with 1650ti GPU and 16GB ram. Whenever I enable pointcloud2 in rviz fps drops to 2-3fps. I guess rviz is not using my GPU. Is there any way to enable the GPU acceleration? I could not find any support.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by shonigmann
close date 2022-07-11 13:35:51.260022

Comments

did you searched it in the web?

https://discourse.ros.org/t/challenge...

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-06-24 06:53:42 -0500 )edit
1

I'm not aware of any ways to force rviz to use a GPU (though they may exist). There is a way to force it to not use a gpu, per http://wiki.ros.org/rviz/Troubleshooting so you could make sure that LIBGL_ALWAYS_SOFTWARE isn't set to true... A few things to check..

  • if you are using Gazebo to simulate the sensor, check that you are using the gazebo_ros_gpu_laser.so plugin and not the default "cpu" variant (gazebo_ros_laser.so)
  • if you start rviz by itself, what is the output related to the graphics drivers? Do you see something like this that indicates that your Nvidia driver is being used?

    [/rviz_1637200062035959003.RenderSystem::detectGlVersion]: OpenGL device: NVIDIA GeForce RTX 3080/PCIe/SSE2 [/rviz_1637200062035959003.RenderSystem::detectGlVersion]: OpenGl version: 4.6 (GLSL 4.6).

  • if not, maybe run nvidia-smi to check that your driver is running

shonigmann gravatar image shonigmann  ( 2022-06-27 11:51:14 -0500 )edit

Thank you so much. I tried reinstalling the Nvidia drivers and it worked.

Saurabh Rahatekar gravatar image Saurabh Rahatekar  ( 2022-07-07 06:13:56 -0500 )edit

Glad that worked out! Just moving my comment to the answers below so this question can be closed.

shonigmann gravatar image shonigmann  ( 2022-07-07 10:43:55 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2022-07-07 10:45:07 -0500

shonigmann gravatar image

Update: in this case, the issue was a faulty NVIDIA driver

I'm not aware of any ways to force rviz to use a GPU (though they may exist). There is a way to force it to not use a gpu, per http://wiki.ros.org/rviz/Troubleshooting so you could make sure that LIBGL_ALWAYS_SOFTWARE isn't set to true... A few things to check..

if you are using Gazebo to simulate the sensor, check that you are using the gazebo_ros_gpu_laser.so plugin and not the default "cpu" variant (gazebo_ros_laser.so) if you start rviz by itself, what is the output related to the graphics drivers? Do you see something like this that indicates that your Nvidia driver is being used?

if not, maybe run nvidia-smi to check that your driver is running

edit flag offensive delete link more

Comments

Yes... Initially, I was checking it using nvidia-smi. I could only see the gazebo using the GPU. After reinstalling the driver RViz finally started using the GPU. Thank you for the coomment.

Saurabh Rahatekar gravatar image Saurabh Rahatekar  ( 2022-07-08 05:04:59 -0500 )edit

@Saurabh Rahatekar could you elaborate more which driver you have reinstalled? I am also facing the same issue, when enable pointlcoud2 topic, the fps drops to 1-5fps, I have checked the nvidia-smi is running and cuda 11.6 with cudnn8 is installed. The driver version would be 515. My GPU card is a RTX3090.

How do you know which application is using GPU from Nvidia-smi?

ThomasL624 gravatar image ThomasL624  ( 2022-11-21 11:31:45 -0500 )edit

Open your terminal with dedicated graphics. And then launch the RViz. It will solve ypur problem. Nvidia-smi shows the processes which are using gpu.

Saurabh Rahatekar gravatar image Saurabh Rahatekar  ( 2022-11-21 11:37:54 -0500 )edit

What do you mean by that? normally i start up the terminal with default hot keys… Nvidia-smi command can be used in normal terminal.

ThomasL624 gravatar image ThomasL624  ( 2022-11-21 13:50:03 -0500 )edit
1

Right click on the terminal icon and you will see the dedicated graphics option. Then launch the RViz from that terminal, RViz will start using the GPU.

Saurabh Rahatekar gravatar image Saurabh Rahatekar  ( 2022-11-21 20:02:13 -0500 )edit

I only got 3 options (New windows, preference, remove from favorite). I am running on a Ubuntu 20.04 pc

ThomasL624 gravatar image ThomasL624  ( 2022-11-23 19:51:02 -0500 )edit

Yes I m running the same ubuntu version. Try reinstalling the gpu drivers or google your issue. I hope you find the solution.

Saurabh Rahatekar gravatar image Saurabh Rahatekar  ( 2022-11-23 20:21:35 -0500 )edit

I will try reinstall the cuda driver on host and see the result

ThomasL624 gravatar image ThomasL624  ( 2022-11-24 00:37:46 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-06-24 03:47:14 -0500

Seen: 3,001 times

Last updated: Jul 07 '22