Skip to content

Commit 3668a17

Browse files
authored
Use gVNIC for GCP A3 VMs (#2585)
1 parent a6edb44 commit 3668a17

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dstack/_internal/core/backends/gcp/resources.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,17 @@ def _get_network_interfaces(
205205
else:
206206
network_interface.access_configs = []
207207

208+
if extra_subnetworks:
209+
# Multiple interfaces are set only for GPU VM that require gVNIC for best performance
210+
network_interface.nic_type = compute_v1.NetworkInterface.NicType.GVNIC.name
211+
208212
network_interfaces = [network_interface]
209213
for network, subnetwork in extra_subnetworks or []:
210214
network_interfaces.append(
211215
compute_v1.NetworkInterface(
212216
network=network,
213217
subnetwork=subnetwork,
218+
nic_type=compute_v1.NetworkInterface.NicType.GVNIC.name,
214219
)
215220
)
216221
return network_interfaces
@@ -437,7 +442,7 @@ def wait_for_operation(operation: Operation, verbose_name: str = "operation", ti
437442
raise
438443
except Exception as e:
439444
# Write only debug logs here.
440-
# The unexpected errors will be propagated and logged appropriatly by the caller.
445+
# The unexpected errors will be propagated and logged appropriately by the caller.
441446
logger.debug("Error during %s: %s", verbose_name, e)
442447
raise operation.exception() or e
443448
return result

0 commit comments

Comments
 (0)