Reference documentation and code samples for the Google Cloud Batch V1 Client class Accelerator.
Accelerator describes Compute Engine accelerators to be attached to the VM.
Generated from protobuf message google.cloud.batch.v1.AllocationPolicy.Accelerator
Namespace
Google \ Cloud \ Batch \ V1 \ AllocationPolicy
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ type
string
The accelerator type. For example, "nvidia-tesla-t4". See gcloud compute accelerator-types list.
↳ count
int|string
The number of accelerators of this type.
↳ install_gpu_drivers
bool
Deprecated: please use instances[0].install_gpu_drivers instead.
↳ driver_version
string
Optional. The NVIDIA GPU driver version that should be installed for this type. You can define the specific driver version such as "470.103.01", following the driver version requirements in https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. Batch will install the specific accelerator driver if qualified.
getType
The accelerator type. For example, "nvidia-tesla-t4".
See gcloud compute accelerator-types list.
Returns
Type
Description
string
setType
The accelerator type. For example, "nvidia-tesla-t4".
See gcloud compute accelerator-types list.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getCount
The number of accelerators of this type.
Returns
Type
Description
int|string
setCount
The number of accelerators of this type.
Parameter
Name
Description
var
int|string
Returns
Type
Description
$this
getInstallGpuDrivers
Deprecated: please use instances[0].install_gpu_drivers instead.
Returns
Type
Description
bool
setInstallGpuDrivers
Deprecated: please use instances[0].install_gpu_drivers instead.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getDriverVersion
Optional. The NVIDIA GPU driver version that should be installed for this
type.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Batch V1 Client - Class Accelerator (1.2.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.2 (latest)](/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy.Accelerator)\n- [1.2.1](/php/docs/reference/cloud-batch/1.2.1/V1.AllocationPolicy.Accelerator)\n- [1.1.7](/php/docs/reference/cloud-batch/1.1.7/V1.AllocationPolicy.Accelerator)\n- [1.0.3](/php/docs/reference/cloud-batch/1.0.3/V1.AllocationPolicy.Accelerator)\n- [0.17.0](/php/docs/reference/cloud-batch/0.17.0/V1.AllocationPolicy.Accelerator)\n- [0.16.10](/php/docs/reference/cloud-batch/0.16.10/V1.AllocationPolicy.Accelerator)\n- [0.15.0](/php/docs/reference/cloud-batch/0.15.0/V1.AllocationPolicy.Accelerator)\n- [0.14.0](/php/docs/reference/cloud-batch/0.14.0/V1.AllocationPolicy.Accelerator)\n- [0.13.1](/php/docs/reference/cloud-batch/0.13.1/V1.AllocationPolicy.Accelerator)\n- [0.12.1](/php/docs/reference/cloud-batch/0.12.1/V1.AllocationPolicy.Accelerator)\n- [0.11.3](/php/docs/reference/cloud-batch/0.11.3/V1.AllocationPolicy.Accelerator)\n- [0.10.0](/php/docs/reference/cloud-batch/0.10.0/V1.AllocationPolicy.Accelerator)\n- [0.9.0](/php/docs/reference/cloud-batch/0.9.0/V1.AllocationPolicy.Accelerator)\n- [0.8.0](/php/docs/reference/cloud-batch/0.8.0/V1.AllocationPolicy.Accelerator)\n- [0.7.0](/php/docs/reference/cloud-batch/0.7.0/V1.AllocationPolicy.Accelerator)\n- [0.6.0](/php/docs/reference/cloud-batch/0.6.0/V1.AllocationPolicy.Accelerator)\n- [0.5.2](/php/docs/reference/cloud-batch/0.5.2/V1.AllocationPolicy.Accelerator)\n- [0.4.0](/php/docs/reference/cloud-batch/0.4.0/V1.AllocationPolicy.Accelerator)\n- [0.3.0](/php/docs/reference/cloud-batch/0.3.0/V1.AllocationPolicy.Accelerator)\n- [0.2.2](/php/docs/reference/cloud-batch/0.2.2/V1.AllocationPolicy.Accelerator) \nReference documentation and code samples for the Google Cloud Batch V1 Client class Accelerator.\n\nAccelerator describes Compute Engine accelerators to be attached to the VM.\n\nGenerated from protobuf message `google.cloud.batch.v1.AllocationPolicy.Accelerator`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Batch \\\\ V1 \\\\ AllocationPolicy\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getType\n\nThe accelerator type. For example, \"nvidia-tesla-t4\".\n\nSee `gcloud compute accelerator-types list`.\n\n### setType\n\nThe accelerator type. For example, \"nvidia-tesla-t4\".\n\nSee `gcloud compute accelerator-types list`.\n\n### getCount\n\nThe number of accelerators of this type.\n\n### setCount\n\nThe number of accelerators of this type.\n\n### getInstallGpuDrivers\n\nDeprecated: please use instances\\[0\\].install_gpu_drivers instead.\n\n### setInstallGpuDrivers\n\nDeprecated: please use instances\\[0\\].install_gpu_drivers instead.\n\n### getDriverVersion\n\nOptional. The NVIDIA GPU driver version that should be installed for this\ntype.\n\nYou can define the specific driver version such as \"470.103.01\",\nfollowing the driver version requirements in\n\u003chttps://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver\u003e.\nBatch will install the specific accelerator driver if qualified.\n\n### setDriverVersion\n\nOptional. The NVIDIA GPU driver version that should be installed for this\ntype.\n\nYou can define the specific driver version such as \"470.103.01\",\nfollowing the driver version requirements in\n\u003chttps://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver\u003e.\nBatch will install the specific accelerator driver if qualified."]]