cuda #3

Supports: xenial bionic
Add to new model


Installs CUDA drivers to instance

Nvidia CUDA Layer

Installs the configured CUDA version with Nvidia drivers when supported GPU
hardware is detected.


The following states are set by this layer:

  • cuda.supported

This state is set when supported GPU hardware is detected.

  • cuda.installed

This state is set once CUDA-related packages are installed and configured.


To use this layer, include it in the layer.yaml of a charm:

  - 'layer:nvidia-cuda'

Build and deploy the charm to a machine with Nvidia GPUs, e.g.
instance-type=p2.xlarge on AWS or instance-type=Standard_NC6 on Azure.


The following runtime configuration options are available in this layer:

  • cuda-version

The cuda-repo package version to install. Defaults to 9.1.85-1.

  juju config <charm> cuda-version=9.1.85-1

Note: This layer constructs a major-minor string from this value and
installs the corresponding cuda-x-y meta package (cuda-9-1 by default).
This package will install the latest available dependencies in this series.

  • install-cuda

When True (the default), install and configure CUDA if capable hardware is
present. Set this to False to prevent installation regardless of hardware

  juju config <charm> install-cuda=True


Disk Space

The packages installed by this layer require approximately 4GB of disk space.
Specify a root-disk constraint if needed to ensure the machine has
adequate disk space for installation. For example:

juju deploy <charm> --constraints "instance-type=p2.xlarge root-disk=16G"

Removing CUDA

When the install-cuda configuration option is set to True, required
packages will be installed and the system will be configured to include
CUDA paths. If install-cuda is subsequently set to False, the system
configuration files created by this layer will be removed; however, the
packages installed by this layer will remain on the system.

Restricted Networks

This layer installs packages from
Configure proxies for Juju models in restricted network environments as needed.
See Configuring Models for information about available proxy options.


(string) Version of the cuda-repo deb to install. Valid options can be found at:
(string) Version of the nvidia driver to install (e.g. nvidia-440)
(boolean) Install the CUDA binaries if capable hardware is present.