8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Gazebo, rviz2でGPUを使うメモ

Posted at

ubuntu 環境でNvidiaのGPUマシンでGazeboやrviz2を実行したときに、そのままだとGPUを使ってくれなかったので
GPUを使う設定方法のメモ

環境変数の追加

以下を実行して環境変数を設定する
毎回実行するのは面倒なので常にGPU有効にする場合は.bashrcに書いておく

export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia

GPUが使われているかの確認

nvidia-smiコマンドを実行して、Gazebo (gzserver, gzclient)、rviz2 (rviz2)のプロセスがあればOK

$ nvidia-smi
                                                 
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1319      G   /usr/lib/xorg/Xorg                 79MiB |
|    0   N/A  N/A      4689    C+G   ...177541916386972095,131072      107MiB |
|    0   N/A  N/A      6184      G   gzserver                            4MiB |
|    0   N/A  N/A      6185      G   gzclient                           78MiB |
|    0   N/A  N/A      6471      G   rviz2                               4MiB |
+-----------------------------------------------------------------------------+

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?