1 Quick reference
- Source repository: rocker-org/rocker-versioned2
- Dockerfile
- tags
- rocker/cuda
- rocker/ml
- rocker/ml-verse
- Published image details: rocker-org/rocker-versioned2’s wiki
- Non-root default user:
- rocker/cuda: not exist
- rocker/ml:
rstudio
- rocker/ml-verse:
rstudio
2 Overview
rocker/cuda
, rocker/ml
, and rocker/ml-verse
are Docker images for machine learning and GPU-based computation in R. These images correspond to rocker/r-ver
, rocker/tidyverse
, and rocker/geospatial
, respectively.
All images are based on the official NVIDIA CUDA docker build recipes, and are installed the reticulate
package.
3 Quick start
The basic usage is the same as rocker/r-ver
or rocker/rstudio
except for the GPU setting.
R command line:
# CPU-only
docker run --rm -ti rocker/cuda
# Machines with nvidia-docker and GPU support
docker run --gpus all --rm -ti rocker/cuda
RStudio Server instance:
# CPU-only
docker run -p 8787:8787 rocker/ml
# Machines with nvidia-docker and GPU support
docker run --gpus all -p 8787:8787 rocker/ml
GPU use requires nvidia-container-toolkit runtime to run!
4 How to use
See also the rocker/r-ver
’s reference (for rocker/cuda
) and the rocker/rstudio
’s reference (for rocker/ml
and rocker/ml-verse
).
4.1 Python versions and environments
If you want to switch the Python version called from reticulate
, you can use the reticulate
’s functions to install Python. For example, with the following command, reticulate
installs miniconda and miniconda installs Python 3.7.
::install_miniconda()
reticulate::conda_install(packages = "python=3.7") reticulate
The Python version used by the reticulate
package can be checked with the reticulate::py_config()
function.
::py_config()
reticulate#> python: /root/.local/share/r-miniconda/envs/r-reticulate/bin/python
#> libpython: /root/.local/share/r-miniconda/envs/r-reticulate/lib/libpython3.7m.so
#> pythonhome: /root/.local/share/r-miniconda/envs/r-reticulate:/root/.local/share/r-miniconda/envs/r-reticulate
#> version: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0]
#> numpy: /root/.local/share/r-miniconda/envs/r-reticulate/lib/python3.7/site-packages/numpy
#> numpy_version: 1.17.5
pyenv and pipenv, which were previously installed, are no longer installed. And, the previously set environment variables WORKON_HOME
and PYTHON_VENV_PATH
are no longer set. (rocker-org/rocker-versioned2#494)