DLR runtime - Amazon IoT Greengrass
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

DLR runtime

The DLR runtime component (variant.DLR) contains a script that installs Deep Learning Runtime (DLR) and its dependencies in a virtual environment on your device. The DLR image classification and DLR object detection components use this component as a dependency for installing DLR. Component version 1.6.x installs DLR v1.6.0 and component version 1.3.x installs DLR v1.3.0.

To use a different runtime, you can use the recipe of this component as a template to create a custom machine learning component.

Versions

This component has the following versions:

  • 1.6.x

  • 1.3.x

Type

This component is a generic component (aws.greengrass.generic). The Greengrass nucleus runs the component's lifecycle scripts.

For more information, see Component types.

Operating system

This component can be installed on core devices that run the following operating systems:

  • Linux

  • Windows

Requirements

This component has the following requirements:

  • On Greengrass core devices running Amazon Linux 2 or Ubuntu 18.04, GNU C Library (glibc) version 2.27 or later installed on the device.

  • On Armv7l devices, such as Raspberry Pi, dependencies for OpenCV-Python installed on the device. Run the following command to install the dependencies.

    sudo apt-get install libopenjp2-7 libilmbase23 libopenexr-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk-3-0 libwebp-dev
  • Raspberry Pi devices that run Raspberry Pi OS Bullseye must meet the following requirements:

    • NumPy 1.22.4 or later installed on the device. Raspberry Pi OS Bullseye includes an earlier version of NumPy, so you can run the following command to upgrade NumPy on the device.

      pip3 install --upgrade numpy
    • The legacy camera stack enabled on the device. Raspberry Pi OS Bullseye includes a new camera stack that is enabled by default and isn't compatible, so you must enable the legacy camera stack.

      To enable the legacy camera stack
      1. Run the following command to open the Raspberry Pi configuration tool.

        sudo raspi-config
      2. Select Interface Options.

      3. Select Legacy camera to enable the legacy camera stack.

      4. Reboot the Raspberry Pi.

Endpoints and ports

By default, this component uses an installer script to install packages using the apt, yum, brew, and pip commands, depending on what platform the core device uses. This component must be able to perform outbound requests to various package indexes and repositories to run the installer script. To allow this component's outbound traffic through a proxy or firewall, you must identify the endpoints for the package indexes and repositories where your core device connects to install.

Consider the following when you identify endpoints required for this component's install script:

  • The endpoints depend on the core device's platform. For example, a core device that runs Ubuntu uses apt rather than yum or brew. Additionally, devices that use the same package index might have different source lists, so they might retrieve packages from different repositories.

  • The endpoints might differ between multiple devices that use the same package index, because each device has its own source lists that define where to retrieve packages.

  • The endpoints might change over time. Each package index provides the URLs of the repositories where you download packages, and the owner of a package can change what URLs the package index provides.

For more information about the dependencies that this component installs, and how to disable the installer script, see the UseInstaller configuration parameter.

For more information about endpoints and ports required for basic operation, see Allow device traffic through a proxy or firewall.

Dependencies

When you deploy a component, Amazon IoT Greengrass also deploys compatible versions of its dependencies. This means that you must meet the requirements for the component and all of its dependencies to successfully deploy the component. This section lists the dependencies for the released versions of this component and the semantic version constraints that define the component versions for each dependency. You can also view the dependencies for each version of the component in the Amazon IoT Greengrass console. On the component details page, look for the Dependencies list.

1.6.11 - 1.6.16

The following table lists the dependencies for versions 1.6.11 to 1.6.16 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <3.0.0 Soft
1.6.10

The following table lists the dependencies for version 1.6.10 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.9.0 Soft
1.6.9

The following table lists the dependencies for version 1.6.9 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.8.0 Soft
1.6.8

The following table lists the dependencies for version 1.6.8 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.7.0 Soft
1.6.6 and 1.6.7

The following table lists the dependencies for versions 1.6.6 and 1.6.7 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.6.0 Soft
1.6.4 and 1.6.5

The following table lists the dependencies for versions 1.6.4 and 1.6.5 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.5.0 Soft
1.6.3

The following table lists the dependencies for version 1.6.3 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.4.0 Soft
1.6.2

The following table lists the dependencies for version 1.6.2 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.3.0 Soft
1.6.1

The following table lists the dependencies for version 1.6.1 of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.0.0 <2.2.0 Soft
1.3.x

The following table lists the dependencies for version 1.3.x of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus ~2.0.0 Soft

For more information about component dependencies, see the component recipe reference.

Configuration

This component provides the following configuration parameters that you can customize when you deploy the component.

MLRootPath

(Optional) The path of the folder on Linux core devices where inference components read images and write inference results. You can modify this value to any location on your device to which the user running this component has read/write access.

Default: /greengrass/v2/work/variant.DLR/greengrass_ml

WindowsMLRootPath

This feature is available in v1.6.6 and later of this component.

(Optional) The path of the folder on Windows core device where inference components read images and write inference results. You can modify this value to any location on your device to which the user running this component has read/write access.

Default: C:\greengrass\v2\\work\\variant.DLR\\greengrass_ml

UseInstaller

(Optional) String value that defines whether to use the installer script in this component to install DLR and its dependencies. Supported values are true and false.

Set this value to false if you want to use a custom script for DLR installation, or if you want to include runtime dependencies in a pre-built Linux image. To use this component with the Amazon-provided DLR inference components, install the following libraries, including any dependencies, and make them available to the system user, such as ggc_user, that runs the ML components.

Default: true

Usage

Use this component with the UseInstaller configuration parameter set to true to install DLR and its dependencies on your device. The component sets up a virtual environment on your device that includes the OpenCV and NumPy libraries that are required for DLR.

Note

The installer script in this component also installs the latest versions of additional system libraries that are required to configure the virtual environment on your device and to use the installed machine learning framework. This might upgrade the existing system libraries on your device. Review the following table for the list of libraries that this component installs for each supported operating system. If you want to customize this installation process, set the UseInstaller configuration parameter to false, and develop your own installer script.

Platform Libraries installed on the device system Libraries installed in the virtual environment
Armv7l build-essential, cmake, ca-certificates, git setuptools, wheel
Amazon Linux 2 mesa-libGL None
Ubuntu wget None

When you deploy your inference component, this runtime component first verifies if your device already has DLR and its dependencies installed, and if not, then it installs them for you.

Local log file

This component uses the following log file.

Linux
/greengrass/v2/logs/variant.DLR.log
Windows
C:\greengrass\v2\logs\variant.DLR.log
To view this component's logs
  • Run the following command on the core device to view this component's log file in real time. Replace /greengrass/v2 or C:\greengrass\v2 with the path to the Amazon IoT Greengrass root folder.

    Linux
    sudo tail -f /greengrass/v2/logs/variant.DLR.log
    Windows (PowerShell)
    Get-Content C:\greengrass\v2\logs\variant.DLR.log -Tail 10 -Wait

Changelog

The following table describes the changes in each version of the component.

Version

Changes

1.6.16

Version updated for Greengrass nucleus version 2.12.5.

1.6.12

Bug fixes and improvements
  • Fixes the installation script for Windows OS users.

1.6.11

Version updated for Greengrass nucleus version 2.9.0 release.

1.6.10

Version updated for Greengrass nucleus version 2.8.0 release.

1.6.9

Version updated for Greengrass nucleus version 2.7.0 release.

1.6.8

Version updated for Greengrass nucleus version 2.6.0 release.

1.6.7

Bug fixes and improvements
  • Updates the UseInstaller installation script to install libGL, which isn't available by default on certain Linux platforms.

  • Updates the UseInstaller installation script to always use Python 3.9 in this component's virtual environment. This change helps ensure compatibility with other libraries.

1.6.6

New features
  • Adds support for core devices that run Windows.

  • Adds the new WindowsMLRootPath configuration parameter that you can use to configure the inference results folder on Windows core devices.

1.6.5

New features
  • Adds the new UseInstaller configuration parameter that you can use to disable the installation script in this component.

1.6.4

Version updated for Greengrass nucleus version 2.4.0 release.

1.6.3

Version updated for Greengrass nucleus version 2.3.0 release.

1.6.2

Version updated for Greengrass nucleus version 2.2.0 release.

1.6.1

New features
  • Install Deep Learning Runtime v1.6.0 and its dependencies.

  • Add support for installing DLR on Armv8 (AArch64) platforms. This extends machine learning support for Greengrass core devices running NVIDIA Jetson, such as the Jetson Nano.

Bug fixes and improvements
  • Install the Amazon IoT Device SDK in the virtual environment to read the component configuration and apply configuration changes.

  • Additional minor bug fixes and improvements.

1.3.2

Initial version. Installs DLR v1.3.0.