About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
windows_first
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation is heavily biased toward Windows environments. All command-line examples use PowerShell, and Windows-specific tools and paths (e.g., C:\ paths, PowerShell cmdlets) are used exclusively. There are no Linux shell or cross-platform command examples, and instructions for Linux or macOS clients are missing or not prioritized. The workflow assumes a Windows client, and Linux alternatives (such as bash commands, Linux file paths, or Linux-native tools) are not mentioned.
Recommendations:
- Provide equivalent Linux/bash shell command examples alongside PowerShell commands for all device and Kubernetes interactions.
- Include instructions for saving kubeconfig files in Linux/macOS home directories (e.g., ~/.kube/config) as well as Windows paths.
- Mention and demonstrate the use of cross-platform tools (e.g., kubectl, ssh) in both Windows and Linux contexts.
- Clarify in the prerequisites and throughout the guide that both Windows and Linux clients are supported, and provide OS-specific notes where necessary.
- Where PowerShell cmdlets are used (e.g., Get-HcsGpuNvidiaSmi, New-HcsKubernetesUser), specify if Linux equivalents exist or provide alternative instructions for Linux users.
- Show example outputs from Linux terminals as well as Windows PowerShell to ensure parity and inclusivity.
Create pull request
Flagged Code Snippets
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
K8S-1HXQG13CL-1HXQG13:
Tue Feb 23 10:34:01 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| 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 Tesla T4 On | 0000041F:00:00.0 Off | 0 |
| N/A 40C P8 15W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
[10.100.10.10]: PS>
[10.100.10.10]: PS>New-HcsKubernetesUser -UserName iotedgeuser
apiVersion: v1
clusters:
- cluster:
certificate-authority-data:
===========================//snipped //======================// snipped //=============================
server: https://compute.myasegpudev.wdshcsso.com:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: iotedgeuser
name: iotedgeuser@kubernetes
current-context: iotedgeuser@kubernetes
kind: Config
preferences: {}
users:
- name: iotedgeuser
user:
client-certificate-data:
===========================//snipped //======================// snipped //=============================
client-key-data:
===========================//snipped //======================// snipped ============================
PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
PS C:\WINDOWS\system32> kubectl get pods -n iotedge --kubeconfig C:\GPU-sharing\kubeconfigs\configiotuser1
NAME READY STATUS RESTARTS AGE
cuda-sample1-869989578c-ssng8 2/2 Running 0 5s
cuda-sample2-6db6d98689-d74kb 2/2 Running 0 4s
edgeagent-79f988968b-7p2tv 2/2 Running 0 6d21h
edgehub-d6c764847-l8v4m 2/2 Running 0 24h
iotedged-55fdb7b5c6-l9zn8 1/1 Running 1 6d21h
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> kubectl -n iotedge --kubeconfig C:\GPU-sharing\kubeconfigs\configiotuser1 logs cuda-sample2-6db6d98689-d74kb cuda-sample2
Run "nbody -benchmark [-numbodies=<numBodies>]" to measure performance.
==============// snipped //===================// snipped //=============
> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
GPU Device 0: "Turing" with compute capability 7.5
> Compute 7.5 CUDA device: [Tesla T4]
40960 bodies, total time for 10000 iterations: 170054.969 ms
= 98.658 billion interactions per second
= 1973.152 single-precision GFLOP/s at 20 flops per interaction
no-op
PS C:\WINDOWS\system32>
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
K8S-1HXQG13CL-1HXQG13:
Thu Mar 4 12:37:39 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| 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 Tesla T4 On | 00002C74:00:00.0 Off | 0 |
| N/A 36C P8 9W / 70W | 28MiB / 15109MiB | 0% E. Process |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 122792 C nvidia-cuda-mps-server 25MiB |
+-----------------------------------------------------------------------------+
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
PS C:\WINDOWS\system32> kubectl get pods -n iotedge --kubeconfig C:\GPU-sharing\kubeconfigs\configiotuser1
NAME READY STATUS RESTARTS AGE
cuda-sample1-869989578c-2zxh6 2/2 Running 0 44s
cuda-sample2-6db6d98689-fn7mx 2/2 Running 0 44s
edgeagent-79f988968b-7p2tv 2/2 Running 0 5d20h
edgehub-d6c764847-l8v4m 2/2 Running 0 27m
iotedged-55fdb7b5c6-l9zn8 1/1 Running 1 5d20h
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> kubectl -n iotedge logs cuda-sample1-869989578c-2zxh6 cuda-sample1
Run "nbody -benchmark [-numbodies=<numBodies>]" to measure performance.
==============// snipped //===================// snipped //=============
> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
GPU Device 0: "Turing" with compute capability 7.5
> Compute 7.5 CUDA device: [Tesla T4]
40960 bodies, total time for 10000 iterations: 155256.062 ms
= 108.062 billion interactions per second
= 2161.232 single-precision GFLOP/s at 20 flops per interaction
no-op
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> kubectl -n iotedge --kubeconfig C:\GPU-sharing\kubeconfigs\configiotuser1 logs cuda-sample2-6db6d98689-fn7mx cuda-sample2
Run "nbody -benchmark [-numbodies=<numBodies>]" to measure performance.
==============// snipped //===================// snipped //=============
> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
GPU Device 0: "Turing" with compute capability 7.5
> Compute 7.5 CUDA device: [Tesla T4]
40960 bodies, total time for 10000 iterations: 155366.359 ms
= 107.985 billion interactions per second
= 2159.697 single-precision GFLOP/s at 20 flops per interaction
no-op
PS C:\WINDOWS\system32>
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
K8S-1HXQG13CL-1HXQG13:
Thu Mar 4 12:59:44 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| 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 Tesla T4 On | 00002C74:00:00.0 Off | 0 |
| N/A 54C P0 69W / 70W | 242MiB / 15109MiB | 100% E. Process |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 56832 M+C /tmp/nbody 107MiB |
| 0 N/A N/A 56900 M+C /tmp/nbody 107MiB |
| 0 N/A N/A 122792 C nvidia-cuda-mps-server 25MiB |
+-----------------------------------------------------------------------------+
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
K8S-1HXQG13CL-1HXQG13:
Fri Mar 5 13:31:16 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| 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 Tesla T4 On | 00002C74:00:00.0 Off | 0 |
| N/A 52C P0 69W / 70W | 221MiB / 15109MiB | 100% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 188342 C /tmp/nbody 109MiB |
| 0 N/A N/A 188413 C /tmp/nbody 109MiB |
+-----------------------------------------------------------------------------+
[10.100.10.10]: PS>
[10.100.10.10]: PS>Get-HcsGpuNvidiaSmi
K8S-1HXQG13CL-1HXQG13:
Fri Mar 5 13:54:48 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| 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 Tesla T4 On | 00002C74:00:00.0 Off | 0 |
| N/A 34C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
[10.100.10.10]: PS>
PS C:\WINDOWS\system32> kubectl -n iotedge --kubeconfig C:\GPU-sharing\kubeconfigs\configiotuser1 logs cuda-sample1-869989578c-ssng8 cuda-sample1
Run "nbody -benchmark [-numbodies=<numBodies>]" to measure performance.
==============// snipped //===================// snipped //=============
> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
GPU Device 0: "Turing" with compute capability 7.5
> Compute 7.5 CUDA device: [Tesla T4]
40960 bodies, total time for 10000 iterations: 170171.531 ms
= 98.590 billion interactions per second
= 1971.801 single-precision GFLOP/s at 20 flops per interaction
no-op
PS C:\WINDOWS\system32>
[10.100.10.10]: PS>Grant-HcsKubernetesNamespaceAccess -Namespace iotedge -UserName iotedgeuser
[10.100.10.10]: PS>
[10.100.10.10]: PS>Start-HcsGpuMPS
K8S-1HXQG13CL-1HXQG13:
Set compute mode to EXCLUSIVE_PROCESS for GPU 0000191E:00:00.0.
All done.
Created nvidia-mps.service
[10.100.10.10]: PS>