I need to create and run Azure spatial analysis container on my desktop machine using WSL. I followed this tutorial: https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/spatial-analysis-container?tabs=desktop-machine. Everything should be running fine according to IoT Hub. But i'm not getting any output and when looking to logs of the spatial-analysis module i saw this error a lot:
2024-03-06T19:46:45.429562642Z <warning> 93 [VIDEO_INGESTER-cognitiveservices_vision_spatialanalysis_1.store.spatialanalysisgraph.videosource] cognitiveservices_vision_spatialanalysis_1 Error: Failed to allocate shared buffer. Skipping frame.
2024-03-06T19:46:45.501593175Z <warning> 93 [VIDEO_INGESTER-cognitiveservices_vision_spatialanalysis_1.store.spatialanalysisgraph.videosource] cognitiveservices_vision_spatialanalysis_1 Failed to get CUDA handle: cudaIpcGetMemHandle failed with error 2
2024-03-06T19:46:45.502484545Z <error> 93 [VIDEO_INGESTER-cognitiveservices_vision_spatialanalysis_1.store.spatialanalysisgraph.videosource] cognitiveservices_vision_spatialanalysis_1 Cannot create cuda shared buffer. Size: 6684672
I have no idea what to do also this is report from nvidia-smi:
| NVIDIA-SMI 530.30.02 Driver Version: 527.99 CUDA Version: 12.0 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3060 L... On | 00000000:01:00.0 On | N/A |
| N/A 55C P8 16W / 115W| 2609MiB / 6144MiB | 28% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+````
I tried restarting the modules and whole IoT edge. Also checked the connectivity to IoT hub and that should be also fine.
Thanks in advance for your help!
The error is due to GPU memory, resulting in a buffer size of 6.6 MB. If your NVIDIA GeForce RTX 3060 has limited available memory, allocating this buffer could cause issues. Make sure you have sufficient space in your system and meet the Spatial Analysis container requirements.
The below are step-by-step guide to install and run the Spatial Analysis container:
Install NVIDIA CUDA Toolkit and Nvidia Graphics Drivers:
Install Docker CE and nvidia-docker2:
Enable NVIDIA MPS:
Configure Azure IoT Edge on the host computer:
Create Azure IoT Hub instance:
Install Azure IoT Edge:
Register IoT Edge device:
Deploy the Spatial Analysis container:
Deploy the container: