Skip to content

Commit cb8db0f

Browse files
committed
Added GPU scenario
1 parent c951fc0 commit cb8db0f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

articles/iot-edge/how-to-use-create-options.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Container create options enable many scenarios, but here are some that come up m
6666
* [Give modules access to host storage](how-to-access-host-storage-from-module.md)
6767
* [Map host port to module port](#map-host-port-to-module-port)
6868
* [Restrict module memory and CPU usage](#restrict-module-memory-and-cpu-usage)
69+
* [GPU-optimize an IoT Edge module](#gpu-optimize-an-iot-edge-module)
6970

7071
### Map host port to module port
7172

@@ -124,6 +125,36 @@ Once stringified for the final deployment manifest, these values would look like
124125
"createOptions":"{\"HostConfig\":{\"Memory\":268435456,\"MemorySwap\":536870912,\"CpuPeriod\":25000}}"
125126
```
126127

128+
### GPU-optimize an IoT Edge module
129+
130+
If you're running your IoT Edge module on a GPU-optimized virtual machine, you can enable an IoT Edge module to connect to your GPU as well. To do this with an existing module, add some specifications to your `createOptions`:
131+
132+
```json
133+
{
134+
"HostConfig": {
135+
"DeviceRequests":
136+
[
137+
{
138+
"Count": -1,
139+
"Capabilities": [
140+
[
141+
"gpu"
142+
]
143+
]
144+
}
145+
]
146+
}
147+
}
148+
```
149+
150+
To confirm these settings were successfully added, use the Docker inspect command to see the new setting in a JSON printout.
151+
152+
```bash
153+
sudo docker inspect <YOUR-MODULE-NAME>
154+
```
155+
156+
To learn more about how your device and virtual machine connect to a GPU, see [Configure, connect, and verify an IoT Edge module for a GPU](configure-connect-verify-gpu.md).
157+
127158
## Next steps
128159

129160
For more examples of create options in action, see the following IoT Edge samples:

0 commit comments

Comments
 (0)