DLR runtime
The DLR runtime component (variant.DLR
) contains a script that installs
Deep Learning Runtime
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
-
Run the following command to open the Raspberry Pi configuration tool.
sudo raspi-config
-
Select Interface Options.
-
Select Legacy camera to enable the legacy camera stack.
-
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 thanyum
orbrew
. 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, AWS 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 AWS IoT Greengrass console
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:
/work/variant.DLR/greengrass_ml/greengrass/v2
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
andfalse
.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 AWS-provided DLR inference components, install the following libraries, including any dependencies, and make them available to the system user, such asggc_user
, that runs the ML components.-
Python
3.7 or later, including pip
for your version of Python. -
Deep Learning Runtime
v1.6.0 -
Picamera
(for Raspberry Pi devices only). -
awscam
module (for AWS DeepLens devices). -
libGL (for Linux devices)
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.
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
or/greengrass/v2
C:\greengrass\v2
with the path to the AWS IoT Greengrass root folder.
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 |
|
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 |
|
1.6.6 |
|
1.6.5 |
|
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 |
|
1.3.2 |
Initial version. Installs DLR v1.3.0. |