|
| 1 | +--- |
| 2 | +description: Adds a GPU partition adapter to a virtual machine. |
| 3 | +external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml |
| 4 | +Module Name: Hyper-V |
| 5 | +ms.date: 09/22/2022 |
| 6 | +online version: https://learn.microsoft.com/powershell/module/hyper-v/add-vmgpupartitionadapter?view=windowsserver2022-ps&wt.mc_id=ps-gethelp |
| 7 | +schema: 2.0.0 |
| 8 | +title: Add-VMGpuPartitionAdapter |
| 9 | +--- |
| 10 | + |
| 11 | +# Add-VMGpuPartitionAdapter |
| 12 | + |
| 13 | +## SYNOPSIS |
| 14 | +Adds a GPU partition adapter to a virtual machine. |
| 15 | + |
| 16 | +## SYNTAX |
| 17 | + |
| 18 | +### VMName (Default) |
| 19 | +``` |
| 20 | +Add-VMGpuPartitionAdapter [-CimSession <CimSession[]>] [-ComputerName <String[]>] |
| 21 | + [-Credential <PSCredential[]>] [-VMName] <String[]> [-Passthru] [-InstancePath <String>] |
| 22 | + [-MinPartitionVRAM <UInt64>] [-MaxPartitionVRAM <UInt64>] [-OptimalPartitionVRAM <UInt64>] |
| 23 | + [-MinPartitionEncode <UInt64>] [-MaxPartitionEncode <UInt64>] [-OptimalPartitionEncode <UInt64>] |
| 24 | + [-MinPartitionDecode <UInt64>] [-MaxPartitionDecode <UInt64>] [-OptimalPartitionDecode <UInt64>] |
| 25 | + [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>] [-WhatIf] |
| 26 | + [-Confirm] [<CommonParameters>] |
| 27 | +``` |
| 28 | + |
| 29 | +### VMObject |
| 30 | +``` |
| 31 | +Add-VMGpuPartitionAdapter [-VM] <VirtualMachine[]> [-Passthru] [-InstancePath <String>] |
| 32 | + [-MinPartitionVRAM <UInt64>] [-MaxPartitionVRAM <UInt64>] [-OptimalPartitionVRAM <UInt64>] |
| 33 | + [-MinPartitionEncode <UInt64>] [-MaxPartitionEncode <UInt64>] [-OptimalPartitionEncode <UInt64>] |
| 34 | + [-MinPartitionDecode <UInt64>] [-MaxPartitionDecode <UInt64>] [-OptimalPartitionDecode <UInt64>] |
| 35 | + [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>] [-WhatIf] |
| 36 | + [-Confirm] [<CommonParameters>] |
| 37 | +``` |
| 38 | + |
| 39 | +## 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. |
| 41 | + |
| 42 | +## EXAMPLES |
| 43 | + |
| 44 | +### Example 1 |
| 45 | +```powershell |
| 46 | +$vm = Get-VM -name "TestVM" |
| 47 | +Add-VMGpuPartitionAdapter -VM $vm |
| 48 | +``` |
| 49 | + |
| 50 | +This example assigns a partition to a specific VM object. |
| 51 | + |
| 52 | +### Example 2 |
| 53 | +```powershell |
| 54 | +$vm = Get-VM -name "TestVM" |
| 55 | +Add-VMGpuPartitionAdapter -VM $vm -Instancepath "SampleGPUInstancePath" |
| 56 | +``` |
| 57 | + |
| 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. |
| 59 | + |
| 60 | +## PARAMETERS |
| 61 | + |
| 62 | +### -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. |
| 66 | + |
| 67 | +```yaml |
| 68 | +Type: CimSession[] |
| 69 | +Parameter Sets: VMName |
| 70 | +Aliases: |
| 71 | + |
| 72 | +Required: False |
| 73 | +Position: Named |
| 74 | +Default value: None |
| 75 | +Accept pipeline input: False |
| 76 | +Accept wildcard characters: False |
| 77 | +``` |
| 78 | +
|
| 79 | +### -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. |
| 84 | +
|
| 85 | +```yaml |
| 86 | +Type: String[] |
| 87 | +Parameter Sets: VMName |
| 88 | +Aliases: |
| 89 | + |
| 90 | +Required: False |
| 91 | +Position: Named |
| 92 | +Default value: None |
| 93 | +Accept pipeline input: False |
| 94 | +Accept wildcard characters: False |
| 95 | +``` |
| 96 | +
|
| 97 | +### -Credential |
| 98 | +Specifies one or more user accounts that have permission to perform this action. |
| 99 | +The default is the current user. |
| 100 | +
|
| 101 | +```yaml |
| 102 | +Type: PSCredential[] |
| 103 | +Parameter Sets: VMName |
| 104 | +Aliases: |
| 105 | + |
| 106 | +Required: False |
| 107 | +Position: Named |
| 108 | +Default value: None |
| 109 | +Accept pipeline input: False |
| 110 | +Accept wildcard characters: False |
| 111 | +``` |
| 112 | +
|
| 113 | +### -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'. |
| 115 | +
|
| 116 | +```yaml |
| 117 | +Type: String |
| 118 | +Parameter Sets: (All) |
| 119 | +Aliases: |
| 120 | + |
| 121 | +Required: False |
| 122 | +Position: Named |
| 123 | +Default value: None |
| 124 | +Accept pipeline input: False |
| 125 | +Accept wildcard characters: False |
| 126 | +``` |
| 127 | +
|
| 128 | +### -MaxPartitionCompute |
| 129 | +The maximum number of compute assigned by the host GPU. This is defined by the manufacturer's driver. |
| 130 | +
|
| 131 | +```yaml |
| 132 | +Type: UInt64 |
| 133 | +Parameter Sets: (All) |
| 134 | +Aliases: |
| 135 | + |
| 136 | +Required: False |
| 137 | +Position: Named |
| 138 | +Default value: None |
| 139 | +Accept pipeline input: False |
| 140 | +Accept wildcard characters: False |
| 141 | +``` |
| 142 | +
|
| 143 | +### -MaxPartitionDecode |
| 144 | +The maximum number of decoders assigned by the host GPU. This is defined by the manufacturer's driver. |
| 145 | +
|
| 146 | +```yaml |
| 147 | +Type: UInt64 |
| 148 | +Parameter Sets: (All) |
| 149 | +Aliases: |
| 150 | + |
| 151 | +Required: False |
| 152 | +Position: Named |
| 153 | +Default value: None |
| 154 | +Accept pipeline input: False |
| 155 | +Accept wildcard characters: False |
| 156 | +``` |
| 157 | +
|
| 158 | +### -MaxPartitionEncode |
| 159 | +The maximum number of encoders assigned by the host GPU. This is defined by the manufacturer's driver. |
| 160 | +
|
| 161 | +```yaml |
| 162 | +Type: UInt64 |
| 163 | +Parameter Sets: (All) |
| 164 | +Aliases: |
| 165 | + |
| 166 | +Required: False |
| 167 | +Position: Named |
| 168 | +Default value: None |
| 169 | +Accept pipeline input: False |
| 170 | +Accept wildcard characters: False |
| 171 | +``` |
| 172 | +
|
| 173 | +### -MaxPartitionVRAM |
| 174 | +The maximum VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver. |
| 175 | +
|
| 176 | +```yaml |
| 177 | +Type: UInt64 |
| 178 | +Parameter Sets: (All) |
| 179 | +Aliases: |
| 180 | + |
| 181 | +Required: False |
| 182 | +Position: Named |
| 183 | +Default value: None |
| 184 | +Accept pipeline input: False |
| 185 | +Accept wildcard characters: False |
| 186 | +``` |
| 187 | +
|
| 188 | +### -MinPartitionCompute |
| 189 | +The minimum number of compute assigned by the host GPU. This is defined by the manufacturer's driver. |
| 190 | +
|
| 191 | +```yaml |
| 192 | +Type: UInt64 |
| 193 | +Parameter Sets: (All) |
| 194 | +Aliases: |
| 195 | + |
| 196 | +Required: False |
| 197 | +Position: Named |
| 198 | +Default value: None |
| 199 | +Accept pipeline input: False |
| 200 | +Accept wildcard characters: False |
| 201 | +``` |
| 202 | +
|
| 203 | +### -MinPartitionDecode |
| 204 | +The minimum number of decoders assigned by the host GPU. This is defined by the manufacturer's driver. |
| 205 | +
|
| 206 | +```yaml |
| 207 | +Type: UInt64 |
| 208 | +Parameter Sets: (All) |
| 209 | +Aliases: |
| 210 | + |
| 211 | +Required: False |
| 212 | +Position: Named |
| 213 | +Default value: None |
| 214 | +Accept pipeline input: False |
| 215 | +Accept wildcard characters: False |
| 216 | +``` |
| 217 | +
|
| 218 | +### -MinPartitionEncode |
| 219 | +The minimum number of encoders assigned by the host GPU. This is defined by the manufacturer's driver. |
| 220 | +
|
| 221 | +```yaml |
| 222 | +Type: UInt64 |
| 223 | +Parameter Sets: (All) |
| 224 | +Aliases: |
| 225 | + |
| 226 | +Required: False |
| 227 | +Position: Named |
| 228 | +Default value: None |
| 229 | +Accept pipeline input: False |
| 230 | +Accept wildcard characters: False |
| 231 | +``` |
| 232 | +
|
| 233 | +### -MinPartitionVRAM |
| 234 | +The minimum VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver. |
| 235 | +
|
| 236 | +```yaml |
| 237 | +Type: UInt64 |
| 238 | +Parameter Sets: (All) |
| 239 | +Aliases: |
| 240 | + |
| 241 | +Required: False |
| 242 | +Position: Named |
| 243 | +Default value: None |
| 244 | +Accept pipeline input: False |
| 245 | +Accept wildcard characters: False |
| 246 | +``` |
| 247 | +
|
| 248 | +### -OptimalPartitionCompute |
| 249 | +The optimal number of compute assigned by the host GPU. This is defined by the manufacturer's driver. |
| 250 | +
|
| 251 | +```yaml |
| 252 | +Type: UInt64 |
| 253 | +Parameter Sets: (All) |
| 254 | +Aliases: |
| 255 | + |
| 256 | +Required: False |
| 257 | +Position: Named |
| 258 | +Default value: None |
| 259 | +Accept pipeline input: False |
| 260 | +Accept wildcard characters: False |
| 261 | +``` |
| 262 | +
|
| 263 | +### -OptimalPartitionDecode |
| 264 | +The optimal number of decoders assigned by the host GPU. This is defined by the manufacturer's driver. |
| 265 | +
|
| 266 | +```yaml |
| 267 | +Type: UInt64 |
| 268 | +Parameter Sets: (All) |
| 269 | +Aliases: |
| 270 | + |
| 271 | +Required: False |
| 272 | +Position: Named |
| 273 | +Default value: None |
| 274 | +Accept pipeline input: False |
| 275 | +Accept wildcard characters: False |
| 276 | +``` |
| 277 | +
|
| 278 | +### -OptimalPartitionEncode |
| 279 | +The optimal number of encoders assigned by the host GPU. This is defined by the manufacturer's driver. |
| 280 | +
|
| 281 | +```yaml |
| 282 | +Type: UInt64 |
| 283 | +Parameter Sets: (All) |
| 284 | +Aliases: |
| 285 | + |
| 286 | +Required: False |
| 287 | +Position: Named |
| 288 | +Default value: None |
| 289 | +Accept pipeline input: False |
| 290 | +Accept wildcard characters: False |
| 291 | +``` |
| 292 | +
|
| 293 | +### -OptimalPartitionVRAM |
| 294 | +The optimal VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver. |
| 295 | +
|
| 296 | +```yaml |
| 297 | +Type: UInt64 |
| 298 | +Parameter Sets: (All) |
| 299 | +Aliases: |
| 300 | + |
| 301 | +Required: False |
| 302 | +Position: Named |
| 303 | +Default value: None |
| 304 | +Accept pipeline input: False |
| 305 | +Accept wildcard characters: False |
| 306 | +``` |
| 307 | +
|
| 308 | +### -Passthru |
| 309 | +Returns an object for each process that the cmdlet started. |
| 310 | +
|
| 311 | +```yaml |
| 312 | +Type: SwitchParameter |
| 313 | +Parameter Sets: (All) |
| 314 | +Aliases: |
| 315 | + |
| 316 | +Required: False |
| 317 | +Position: Named |
| 318 | +Default value: None |
| 319 | +Accept pipeline input: False |
| 320 | +Accept wildcard characters: False |
| 321 | +``` |
| 322 | +
|
| 323 | +### -VM |
| 324 | +Specifies the virtual machine on which the network adapter is to be added. |
| 325 | +
|
| 326 | +```yaml |
| 327 | +Type: VirtualMachine[] |
| 328 | +Parameter Sets: VMObject |
| 329 | +Aliases: |
| 330 | + |
| 331 | +Required: True |
| 332 | +Position: 0 |
| 333 | +Default value: None |
| 334 | +Accept pipeline input: True (ByValue) |
| 335 | +Accept wildcard characters: False |
| 336 | +``` |
| 337 | +
|
| 338 | +### -VMName |
| 339 | +Specifies the name of the virtual machine on which the network adapter is to be added. |
| 340 | +
|
| 341 | +```yaml |
| 342 | +Type: String[] |
| 343 | +Parameter Sets: VMName |
| 344 | +Aliases: |
| 345 | + |
| 346 | +Required: True |
| 347 | +Position: 0 |
| 348 | +Default value: None |
| 349 | +Accept pipeline input: True (ByValue) |
| 350 | +Accept wildcard characters: False |
| 351 | +``` |
| 352 | +
|
| 353 | +### -Confirm |
| 354 | +Prompts you for confirmation before running the cmdlet. |
| 355 | +
|
| 356 | +```yaml |
| 357 | +Type: SwitchParameter |
| 358 | +Parameter Sets: (All) |
| 359 | +Aliases: cf |
| 360 | + |
| 361 | +Required: False |
| 362 | +Position: Named |
| 363 | +Default value: None |
| 364 | +Accept pipeline input: False |
| 365 | +Accept wildcard characters: False |
| 366 | +``` |
| 367 | +
|
| 368 | +### -WhatIf |
| 369 | +Shows what would happen if the cmdlet runs. |
| 370 | +The cmdlet is not run. |
| 371 | +
|
| 372 | +```yaml |
| 373 | +Type: SwitchParameter |
| 374 | +Parameter Sets: (All) |
| 375 | +Aliases: wi |
| 376 | + |
| 377 | +Required: False |
| 378 | +Position: Named |
| 379 | +Default value: None |
| 380 | +Accept pipeline input: False |
| 381 | +Accept wildcard characters: False |
| 382 | +``` |
| 383 | +
|
| 384 | +### 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). |
| 386 | +
|
| 387 | +## INPUTS |
| 388 | +
|
| 389 | +### Microsoft.HyperV.PowerShell.VirtualMachine[] |
| 390 | +
|
| 391 | +### System.String[] |
| 392 | +
|
| 393 | +## OUTPUTS |
| 394 | +
|
| 395 | +### Microsoft.HyperV.PowerShell.VMGpuPartitionAdapter |
| 396 | +
|
| 397 | +## NOTES |
| 398 | +
|
| 399 | +## RELATED LINKS |
0 commit comments