Skip to content

Instantly share code, notes, and snippets.

@wecacuee
Last active April 29, 2020 21:29
Show Gist options
  • Save wecacuee/ec13e85fc1e456f5a34e70d6e349bda0 to your computer and use it in GitHub Desktop.
Save wecacuee/ec13e85fc1e456f5a34e70d6e349bda0 to your computer and use it in GitHub Desktop.
Getting started with rocker + rviz

install docker

sudo apt install docker.io

test docker

    $ docker run hello-world

    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    ca4f61b1923c: Pull complete
    Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    ...

Add the package repositories

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker

test nvidia container toolkit

$ docker run -it --rm --gpus all ubuntu nvidia-smi
Wed Apr 29 21:16:27 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00    Driver Version: 440.64.00    CUDA Version: N/A      |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  On   | 00000000:65:00.0  On |                  N/A |
|  0%   37C    P8    24W / 260W |     96MiB / 11016MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

pip install rocker

test rocker

rocker --nvidia --x11 --user --home --pull osrf:melodic-desktop-full rviz

you should see a pop up complaining about "unable to contact master"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment