2
2
description : Adds a GPU partition adapter to a virtual machine.
3
3
external help file : Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml
4
4
Module Name : Hyper-V
5
- ms.date : 09/22/2022
5
+ ms.date : 06/12/2024
6
6
online version : https://learn.microsoft.com/powershell/module/hyper-v/add-vmgpupartitionadapter?view=windowsserver2025-ps&wt.mc_id=ps-gethelp
7
7
schema : 2.0.0
8
8
title : Add-VMGpuPartitionAdapter
@@ -16,53 +16,62 @@ Adds a GPU partition adapter to a virtual machine.
16
16
## SYNTAX
17
17
18
18
### VMName (Default)
19
+
19
20
```
20
21
Add-VMGpuPartitionAdapter [-CimSession <CimSession[]>] [-ComputerName <String[]>]
21
22
[-Credential <PSCredential[]>] [-VMName] <String[]> [-Passthru] [-InstancePath <String>]
22
23
[-MinPartitionVRAM <UInt64>] [-MaxPartitionVRAM <UInt64>] [-OptimalPartitionVRAM <UInt64>]
23
24
[-MinPartitionEncode <UInt64>] [-MaxPartitionEncode <UInt64>] [-OptimalPartitionEncode <UInt64>]
24
25
[-MinPartitionDecode <UInt64>] [-MaxPartitionDecode <UInt64>] [-OptimalPartitionDecode <UInt64>]
25
- [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>] [-WhatIf]
26
- [-Confirm] [<CommonParameters>]
26
+ [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>]
27
+ [-WhatIf] [- Confirm] [<CommonParameters>]
27
28
```
28
29
29
30
### VMObject
31
+
30
32
```
31
33
Add-VMGpuPartitionAdapter [-VM] <VirtualMachine[]> [-Passthru] [-InstancePath <String>]
32
34
[-MinPartitionVRAM <UInt64>] [-MaxPartitionVRAM <UInt64>] [-OptimalPartitionVRAM <UInt64>]
33
35
[-MinPartitionEncode <UInt64>] [-MaxPartitionEncode <UInt64>] [-OptimalPartitionEncode <UInt64>]
34
36
[-MinPartitionDecode <UInt64>] [-MaxPartitionDecode <UInt64>] [-OptimalPartitionDecode <UInt64>]
35
- [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>] [-WhatIf]
36
- [-Confirm] [<CommonParameters>]
37
+ [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>]
38
+ [-WhatIf] [- Confirm] [<CommonParameters>]
37
39
```
38
40
39
41
## DESCRIPTION
40
- The 'Add-VMGpuPartitionAdapter' cmdlet adds a GPU partition adapter to a virtual machine. With no parameter, it assigns a full partition from an assignable GPU to a VM.
42
+
43
+ The ` Add-VMGpuPartitionAdapter ` cmdlet adds a GPU partition adapter to a virtual machine. With no
44
+ parameter, it assigns a full partition from an assignable GPU to a VM.
41
45
42
46
## EXAMPLES
43
47
44
48
### Example 1
49
+
45
50
``` powershell
46
- $vm = Get-VM -name "TestVM"
51
+ $vm = Get-VM -Name "TestVM"
47
52
Add-VMGpuPartitionAdapter -VM $vm
48
53
```
49
54
50
55
This example assigns a partition to a specific VM object.
51
56
52
57
### Example 2
58
+
53
59
``` powershell
54
- $vm = Get-VM -name "TestVM"
55
- Add-VMGpuPartitionAdapter -VM $vm -Instancepath "SampleGPUInstancePath "
60
+ $vm = Get-VM -Name "TestVM"
61
+ Add-VMGpuPartitionAdapter -VM $vm -InstancePath "GPUInstancePath "
56
62
```
57
63
58
- This example assigns a partition from a specific GPU to a VM where the instance path is the GPU device ID name on the host.
64
+ This example assigns a partition from a specific GPU to a VM where the instance path is the GPU
65
+ device ID name on the host.
59
66
60
67
## PARAMETERS
61
68
62
69
### -CimSession
63
- Runs the cmdlet in a remote session or on a remote computer.
64
- Enter a computer name or a session object, such as the output of a [ New-CimSession] ( https://go.microsoft.com/fwlink/p/?LinkId=227967 ) or [ Get-CimSession] ( https://go.microsoft.com/fwlink/p/?LinkId=227966 ) cmdlet.
65
- The default is the current session on the local computer.
70
+
71
+ Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session
72
+ object, such as the output of a [ New-CimSession] ( /powershell/module/cimcmdlets/new-cimsession )
73
+ or [ Get-CimSession] ( /powershell/module/cimcmdlets/get-cimsession ) cmdlet. The default is the
74
+ current session on the local computer.
66
75
67
76
``` yaml
68
77
Type : CimSession[]
@@ -77,10 +86,10 @@ Accept wildcard characters: False
77
86
` ` `
78
87
79
88
### -ComputerName
80
- Specifies one or more Hyper-V hosts from which virtual machines are to be retrieved.
81
- NetBIOS names, IP addresses, and fully qualified domain names are allowable.
82
- The default is the local computer.
83
- Use localhost or a dot ('.' ) to specify the local computer explicitly.
89
+
90
+ Specifies one or more Hyper-V hosts from which virtual machines are to be retrieved. NetBIOS names,
91
+ IP addresses, and fully qualified domain names are allowable. The default is the local computer.
92
+ Use localhost or a dot (` .` ) to specify the local computer explicitly.
84
93
85
94
` ` ` yaml
86
95
Type: String[]
@@ -95,8 +104,9 @@ Accept wildcard characters: False
95
104
` ` `
96
105
97
106
# ## -Credential
98
- Specifies one or more user accounts that have permission to perform this action.
99
- The default is the current user.
107
+
108
+ Specifies one or more user accounts that have permission to perform this action. The default is the
109
+ current user.
100
110
101
111
` ` ` yaml
102
112
Type: PSCredential[]
@@ -111,7 +121,9 @@ Accept wildcard characters: False
111
121
` ` `
112
122
113
123
# ## -InstancePath
114
- Represents the Device Instance path of a GPU in the host. This value can be obtained from the "Name" property of the command 'Get-VMHostPartitionableGpu'.
124
+
125
+ Represents the Device Instance path of a GPU in the host. This value can be obtained from the
126
+ " Name" property of the command `Get-VMHostPartitionableGpu`.
115
127
116
128
` ` ` yaml
117
129
Type: String
@@ -126,7 +138,9 @@ Accept wildcard characters: False
126
138
` ` `
127
139
128
140
# ## -MaxPartitionCompute
129
- The maximum number of compute assigned by the host GPU. This is defined by the manufacturer's driver.
141
+
142
+ The maximum number of compute assigned by the host GPU. This is defined by the manufacturer's
143
+ driver.
130
144
131
145
` ` ` yaml
132
146
Type: UInt64
@@ -141,7 +155,9 @@ Accept wildcard characters: False
141
155
` ` `
142
156
143
157
# ## -MaxPartitionDecode
144
- The maximum number of decoders assigned by the host GPU. This is defined by the manufacturer's driver.
158
+
159
+ The maximum number of decoders assigned by the host GPU. This is defined by the manufacturer's
160
+ driver.
145
161
146
162
` ` ` yaml
147
163
Type: UInt64
@@ -156,7 +172,9 @@ Accept wildcard characters: False
156
172
` ` `
157
173
158
174
# ## -MaxPartitionEncode
159
- The maximum number of encoders assigned by the host GPU. This is defined by the manufacturer's driver.
175
+
176
+ The maximum number of encoders assigned by the host GPU. This is defined by the manufacturer's
177
+ driver.
160
178
161
179
` ` ` yaml
162
180
Type: UInt64
@@ -171,6 +189,7 @@ Accept wildcard characters: False
171
189
` ` `
172
190
173
191
# ## -MaxPartitionVRAM
192
+
174
193
The maximum VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver.
175
194
176
195
` ` ` yaml
@@ -186,7 +205,9 @@ Accept wildcard characters: False
186
205
` ` `
187
206
188
207
# ## -MinPartitionCompute
189
- The minimum number of compute assigned by the host GPU. This is defined by the manufacturer's driver.
208
+
209
+ The minimum number of compute assigned by the host GPU. This is defined by the manufacturer's
210
+ driver.
190
211
191
212
` ` ` yaml
192
213
Type: UInt64
@@ -201,7 +222,9 @@ Accept wildcard characters: False
201
222
` ` `
202
223
203
224
# ## -MinPartitionDecode
204
- The minimum number of decoders assigned by the host GPU. This is defined by the manufacturer's driver.
225
+
226
+ The minimum number of decoders assigned by the host GPU. This is defined by the manufacturer's
227
+ driver.
205
228
206
229
` ` ` yaml
207
230
Type: UInt64
@@ -216,7 +239,9 @@ Accept wildcard characters: False
216
239
` ` `
217
240
218
241
# ## -MinPartitionEncode
219
- The minimum number of encoders assigned by the host GPU. This is defined by the manufacturer's driver.
242
+
243
+ The minimum number of encoders assigned by the host GPU. This is defined by the manufacturer's
244
+ driver.
220
245
221
246
` ` ` yaml
222
247
Type: UInt64
@@ -231,6 +256,7 @@ Accept wildcard characters: False
231
256
` ` `
232
257
233
258
# ## -MinPartitionVRAM
259
+
234
260
The minimum VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver.
235
261
236
262
` ` ` yaml
@@ -246,7 +272,9 @@ Accept wildcard characters: False
246
272
` ` `
247
273
248
274
# ## -OptimalPartitionCompute
249
- The optimal number of compute assigned by the host GPU. This is defined by the manufacturer's driver.
275
+
276
+ The optimal number of compute assigned by the host GPU. This is defined by the manufacturer's
277
+ driver.
250
278
251
279
` ` ` yaml
252
280
Type: UInt64
@@ -261,7 +289,9 @@ Accept wildcard characters: False
261
289
` ` `
262
290
263
291
# ## -OptimalPartitionDecode
264
- The optimal number of decoders assigned by the host GPU. This is defined by the manufacturer's driver.
292
+
293
+ The optimal number of decoders assigned by the host GPU. This is defined by the manufacturer's
294
+ driver.
265
295
266
296
` ` ` yaml
267
297
Type: UInt64
@@ -276,7 +306,9 @@ Accept wildcard characters: False
276
306
` ` `
277
307
278
308
# ## -OptimalPartitionEncode
279
- The optimal number of encoders assigned by the host GPU. This is defined by the manufacturer's driver.
309
+
310
+ The optimal number of encoders assigned by the host GPU. This is defined by the manufacturer's
311
+ driver.
280
312
281
313
` ` ` yaml
282
314
Type: UInt64
@@ -291,6 +323,7 @@ Accept wildcard characters: False
291
323
` ` `
292
324
293
325
# ## -OptimalPartitionVRAM
326
+
294
327
The optimal VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver.
295
328
296
329
` ` ` yaml
@@ -306,6 +339,7 @@ Accept wildcard characters: False
306
339
` ` `
307
340
308
341
# ## -Passthru
342
+
309
343
Returns an object for each process that the cmdlet started.
310
344
311
345
` ` ` yaml
@@ -321,6 +355,7 @@ Accept wildcard characters: False
321
355
` ` `
322
356
323
357
# ## -VM
358
+
324
359
Specifies the virtual machine on which the network adapter is to be added.
325
360
326
361
` ` ` yaml
@@ -336,6 +371,7 @@ Accept wildcard characters: False
336
371
` ` `
337
372
338
373
# ## -VMName
374
+
339
375
Specifies the name of the virtual machine on which the network adapter is to be added.
340
376
341
377
` ` ` yaml
@@ -351,6 +387,7 @@ Accept wildcard characters: False
351
387
` ` `
352
388
353
389
# ## -Confirm
390
+
354
391
Prompts you for confirmation before running the cmdlet.
355
392
356
393
` ` ` yaml
@@ -366,8 +403,8 @@ Accept wildcard characters: False
366
403
` ` `
367
404
368
405
# ## -WhatIf
369
- Shows what would happen if the cmdlet runs.
370
- The cmdlet is not run.
406
+
407
+ Shows what would happen if the cmdlet runs. The cmdlet is not run.
371
408
372
409
` ` ` yaml
373
410
Type: SwitchParameter
@@ -382,7 +419,11 @@ Accept wildcard characters: False
382
419
` ` `
383
420
384
421
# ## CommonParameters
385
- This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
422
+
423
+ This cmdlet supports the common parameters : -Debug, -ErrorAction, -ErrorVariable,
424
+ -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
425
+ -WarningAction, and -WarningVariable. For more information, see
426
+ [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
386
427
387
428
# # INPUTS
388
429
@@ -397,3 +438,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
397
438
# # NOTES
398
439
399
440
# # RELATED LINKS
441
+
442
+ - [Get-VMGpuPartitionAdapter](get-vmgpupartitionadapter.md)
443
+
444
+ - [Remove-VMGpuPartitionAdapter](remove-vmgpupartitionadapter.md)
445
+
446
+ - [Set-VMGpuPartitionAdapter](set-vmgpupartitionadapter.md)
0 commit comments