Azure Spatial Analysis IoT edge module runtime status Error

ho chan 0 Reputation points
2023-02-13T13:05:01.72+00:00

Hi, I am following below link to create IoT Edge setup

https://video2.skills-academy.com/en-us/azure/iot-edge/how-to-provision-single-device-linux-symmetric?view=iotedge-1.4&tabs=azure-portal%2Cubuntu

https://video2.skills-academy.com/en-us/azure/cognitive-services/computer-vision/spatial-analysis-container?tabs=azure-stack-edge

By following above links I am successfully able to create IoT Edge and IoT Hub in my azure VM.

But while deploying the spatial analysis module (Azure VM with GPU), the module is not deployed in my IoT Edge VM and the module running status is "Error" on IoT hub Portal and I getting below error

User's image

User's image

User's image

DeploymentManifest.json

{
    "modulesContent": {
        "$edgeAgent": {
            "properties.desired": {
                "modules": {
                    "spatialanalysis": {
                        "settings": {
                            "image": "mcr.microsoft.com/azure-cognitive-services/vision/spatial-analysis:latest",
                            "createOptions": "{\"HostConfig\":{\"Binds\":[\"/tmp/.X11-unix:/tmp/.X11-unix\"],\"Runtime\":\"nvidia\",\"ShmSize\":536870911,\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"100m\",\"max-file\":\"2000\"}}}}"
                        },
                        "type": "docker",
                        "env": {
                            "DISPLAY": {
                                "value": ":1"
                            },
                            "QT_X11_NO_MITSHM": {
                                "value": "1"
                            },
                            "ARCHON_LOG_LEVEL": {
                                "value": "info"
                            },
                            "ARCHON_SHARED_BUFFER_LIMIT": {
                                "value": "377487360"
                            },
                            "OMP_WAIT_POLICY": {
                                "value": "PASSIVE"
                            },
                            "EULA": {
                                "value": "accept"
                            },
                            "BILLING":{
                                "value": "https://computer-vision.cognitiveservices.azure.com/"
                            },
                            "APIKEY":{
                                "value": "{{key}}"
                            }
                        },
                        "status": "running",
                        "restartPolicy": "always",
                        "version": "1.0"
                    }
                },
                "runtime": {
                    "type": "docker",
                    "settings": {
                        "minDockerVersion": "v1.25"
                        }
                },
                "schemaVersion": "1.0",
                "systemModules": {
                    "edgeAgent": {
                        "settings": {
                            "image": "mcr.microsoft.com/azureiotedge-agent:1.0",
                            "createOptions": ""
                        },
                        "type": "docker"
                    },
                    "edgeHub": {
                        "settings": {
                            "image": "mcr.microsoft.com/azureiotedge-hub:1.0",
                            "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"443/tcp\":[{\"HostPort\":\"443\"}],\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}]}}}"
                        },
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always"
                    }
                }
            }
        },
        "$edgeHub": {
            "properties.desired": {
                "routes": {
                    "route": "FROM /messages/* INTO $upstream"
                },
                "schemaVersion": "1.0",
                "storeAndForwardConfiguration": {
                    "timeToLiveSecs": 7200
                }
            }
        },
        "spatialanalysis": {
            "properties.desired": {
                "globalSettings": {
                    "PlatformTelemetryEnabled": false,
                    "CustomerTelemetryEnabled": true
                },
                "graphs": {
                    "personcount": {
                        "operationId": "cognitiveservices.vision.spatialanalysis-personcount",
                        "version": 1,
                        "enabled": true,
                        "parameters": {
                            "VIDEO_URL": "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4",
                            "VIDEO_SOURCE_ID": "personcountgraph",
                            "VIDEO_DECODE_GPU_INDEX": 0,
                            "VIDEO_IS_LIVE":true,
                            "DETECTOR_NODE_CONFIG": "{ \"gpu_index\": 0 }",
                            "SPACEANALYTICS_CONFIG": "{\"zones\":[{\"name\":\"queue\",\"polygon\":[[0.0,0.0],[1.0,0.0],[1.0,1.0],[0.0,1.0],[0.0,0.0]], \"events\": [{\"type\":\"count\", \"config\":{\"trigger\": \"event\"}}]}]}"
                        }
                    }
                }
            }
        },
        "diagnostics": {
            "properties.desired": {}
        }
    }
}
sudo az iot edge set-modules --hub-name "TEST-1" --device-id "TEST" --content DeploymentManifest.json

[
  {
    "authentication": {
      "symmetricKey": {
        "primaryKey": "{{primaryKey}}",
        "secondaryKey": "{{secondaryKey}}"
      },
      "type": "sas",
      "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
      }
    },
    "cloudToDeviceMessageCount": 0,
    "connectionState": "Disconnected",
    "connectionStateUpdatedTime": "0001-01-01T00:00:00+00:00",
    "deviceId": "TEST",
    "etag": "NDE0Mzg0Nw==",
    "generationId": "{{generationId}}",
    "lastActivityTime": "0001-01-01T00:00:00+00:00",
    "managedBy": null,
    "moduleId": "$edgeAgent"
  },
  {
    "authentication": {
      "symmetricKey": {
        "primaryKey": "{{primaryKey}}",
        "secondaryKey": "{{secondaryKey}}"
      },
      "type": "sas",
      "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
      }
    },
    "cloudToDeviceMessageCount": 0,
    "connectionState": "Connected",
    "connectionStateUpdatedTime": "2023-02-13T09:10:04.694581+00:00",
    "deviceId": "ROBOT-104",
    "etag": "NDE0Mzg1MA==",
    "generationId": "{{generationId}}",
    "lastActivityTime": "0001-01-01T00:00:00+00:00",
    "managedBy": null,
    "moduleId": "$edgeHub"
  },
  {
    "authentication": {
      "symmetricKey": {
        "primaryKey": "{{primaryKey}}",
        "secondaryKey": "{{secondaryKey}}"
      },
      "type": "sas",
      "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
      }
    },
    "cloudToDeviceMessageCount": 0,
    "connectionState": "Disconnected",
    "connectionStateUpdatedTime": "0001-01-01T00:00:00+00:00",
    "deviceId": "ROBOT-104",
    "etag": "NTI0MjQxMTky",
    "generationId": "{{generationId}}",
    "lastActivityTime": "0001-01-01T00:00:00+00:00",
    "managedBy": null,
    "moduleId": "DefenderIotMicroAgent"
  },
  {
    "authentication": {
      "symmetricKey": {
        "primaryKey": null,
        "secondaryKey": null
      },
      "type": "none",
      "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
      }
    },
    "cloudToDeviceMessageCount": 0,
    "connectionState": "Disconnected",
    "connectionStateUpdatedTime": "0001-01-01T00:00:00+00:00",
    "deviceId": "ROBOT-104",
    "etag": "NjQ2NTkzMjI1",
    "generationId": "{{generationId}}",
    "lastActivityTime": "0001-01-01T00:00:00+00:00",
    "managedBy": "iotEdge",
    "moduleId": "diagnostics"
  },
  {
    "authentication": {
      "symmetricKey": {
        "primaryKey": "{{primaryKey}}",
        "secondaryKey": "{{secondaryKey}}"
      },
      "type": "sas",
      "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
      }
    },
    "cloudToDeviceMessageCount": 0,
    "connectionState": "Disconnected",
    "connectionStateUpdatedTime": "0001-01-01T00:00:00+00:00",
    "deviceId": "ROBOT-104",
    "etag": "ODk4MjU1NjM4",
    "generationId": "{{generationId}}",
    "lastActivityTime": "0001-01-01T00:00:00+00:00",
    "managedBy": null,
    "moduleId": "spatialanalysis"
  }
]
Azure AI Video Indexer
Azure AI Video Indexer
An Azure video analytics service that uses AI to extract actionable insights from stored videos.
68 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
557 questions
Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
338 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,149 questions
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,186 Reputation points
    2023-02-16T23:31:34.89+00:00

    Hello ho chan,

    I think the Type of the VM requirement is very important, please confirm if you are trying to use the right size VM with right GPU?

    Spatial Analysis container requirements

    User's image

    Request the quota increase for your subscription:

    User's image

    User's image

    If this answers your query, do click Accept Answer and **Yes** for this answer as helpful. And, if you have any further query do let us know by writing in the below comment section.