Reference documentation and code samples for the Batch V1 API class Google::Cloud::Batch::V1::AllocationPolicy::Accelerator.
Accelerator describes Compute Engine accelerators to be attached to the VM.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#count
defcount()->::Integer
Returns
(::Integer) — The number of accelerators of this type.
#count=
defcount=(value)->::Integer
Parameter
value (::Integer) — The number of accelerators of this type.
Returns
(::Integer) — The number of accelerators of this type.
#driver_version
defdriver_version()->::String
Returns
(::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.
#driver_version=
defdriver_version=(value)->::String
Parameter
value (::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.
Returns
(::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.
#install_gpu_drivers
definstall_gpu_drivers()->::Boolean
Returns
(::Boolean) — Deprecated: please use instances[0].install_gpu_drivers instead.
#install_gpu_drivers=
definstall_gpu_drivers=(value)->::Boolean
Parameter
value (::Boolean) — Deprecated: please use instances[0].install_gpu_drivers instead.
Returns
(::Boolean) — Deprecated: please use instances[0].install_gpu_drivers instead.
#type
deftype()->::String
Returns
(::String) — The accelerator type. For example, "nvidia-tesla-t4".
See gcloud compute accelerator-types list.
#type=
deftype=(value)->::String
Parameter
value (::String) — The accelerator type. For example, "nvidia-tesla-t4".
See gcloud compute accelerator-types list.
Returns
(::String) — The accelerator type. For example, "nvidia-tesla-t4".
See gcloud compute accelerator-types list.
[[["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-09 UTC."],[],[],null,["# Batch V1 API - Class Google::Cloud::Batch::V1::AllocationPolicy::Accelerator (v1.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.0 (latest)](/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [1.1.1](/ruby/docs/reference/google-cloud-batch-v1/1.1.1/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [1.0.0](/ruby/docs/reference/google-cloud-batch-v1/1.0.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.21.0](/ruby/docs/reference/google-cloud-batch-v1/0.21.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.20.1](/ruby/docs/reference/google-cloud-batch-v1/0.20.1/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.19.2](/ruby/docs/reference/google-cloud-batch-v1/0.19.2/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.18.3](/ruby/docs/reference/google-cloud-batch-v1/0.18.3/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.17.4](/ruby/docs/reference/google-cloud-batch-v1/0.17.4/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.16.2](/ruby/docs/reference/google-cloud-batch-v1/0.16.2/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.15.1](/ruby/docs/reference/google-cloud-batch-v1/0.15.1/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.14.0](/ruby/docs/reference/google-cloud-batch-v1/0.14.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.13.1](/ruby/docs/reference/google-cloud-batch-v1/0.13.1/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.12.0](/ruby/docs/reference/google-cloud-batch-v1/0.12.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.11.1](/ruby/docs/reference/google-cloud-batch-v1/0.11.1/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.10.5](/ruby/docs/reference/google-cloud-batch-v1/0.10.5/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.9.0](/ruby/docs/reference/google-cloud-batch-v1/0.9.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.8.0](/ruby/docs/reference/google-cloud-batch-v1/0.8.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.7.0](/ruby/docs/reference/google-cloud-batch-v1/0.7.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.6.0](/ruby/docs/reference/google-cloud-batch-v1/0.6.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.5.0](/ruby/docs/reference/google-cloud-batch-v1/0.5.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.4.3](/ruby/docs/reference/google-cloud-batch-v1/0.4.3/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.3.0](/ruby/docs/reference/google-cloud-batch-v1/0.3.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.2.0](/ruby/docs/reference/google-cloud-batch-v1/0.2.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator)\n- [0.1.0](/ruby/docs/reference/google-cloud-batch-v1/0.1.0/Google-Cloud-Batch-V1-AllocationPolicy-Accelerator) \nReference documentation and code samples for the Batch V1 API class Google::Cloud::Batch::V1::AllocationPolicy::Accelerator.\n\nAccelerator describes Compute Engine accelerators to be attached to the VM. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #count\n\n def count() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- The number of accelerators of this type.\n\n### #count=\n\n def count=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- The number of accelerators of this type. \n**Returns**\n\n- (::Integer) --- The number of accelerators of this type.\n\n### #driver_version\n\n def driver_version() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The NVIDIA GPU driver version that should be installed for this type.\n\n You can define the specific driver version such as \"470.103.01\",\n following the driver version requirements in\n https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.\n Batch will install the specific accelerator driver if qualified.\n\n### #driver_version=\n\n def driver_version=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. The NVIDIA GPU driver version that should be installed for this type.\n\n\n You can define the specific driver version such as \"470.103.01\",\n following the driver version requirements in\n https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.\nBatch will install the specific accelerator driver if qualified. \n**Returns**\n\n- (::String) --- Optional. The NVIDIA GPU driver version that should be installed for this type.\n\n You can define the specific driver version such as \"470.103.01\",\n following the driver version requirements in\n https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.\n Batch will install the specific accelerator driver if qualified.\n\n### #install_gpu_drivers\n\n def install_gpu_drivers() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Deprecated: please use instances\\[0\\].install_gpu_drivers instead.\n\n### #install_gpu_drivers=\n\n def install_gpu_drivers=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Deprecated: please use instances\\[0\\].install_gpu_drivers instead. \n**Returns**\n\n- (::Boolean) --- Deprecated: please use instances\\[0\\].install_gpu_drivers instead.\n\n### #type\n\n def type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The accelerator type. For example, \"nvidia-tesla-t4\". See `gcloud compute accelerator-types list`.\n\n### #type=\n\n def type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The accelerator type. For example, \"nvidia-tesla-t4\". See `gcloud compute accelerator-types list`. \n**Returns**\n\n- (::String) --- The accelerator type. For example, \"nvidia-tesla-t4\". See `gcloud compute accelerator-types list`."]]