Skip to content

Commit

Permalink
enhance(gcp): Add NVIDIA L4 GPU guest accelerator
Browse files Browse the repository at this point in the history
  • Loading branch information
vdmgolub committed Feb 15, 2024
1 parent 5ffa663 commit 5057810
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
├─ Standard provisioned storage (pd-standard) 10 GB $0.40
└─ NVIDIA Tesla K80 (on-demand) 2,920 hours $919.80

google_compute_instance.gpu_l4
├─ Instance usage (Linux/UNIX, on-demand, g2-standard-4) 730 hours $515.99
├─ Standard provisioned storage (pd-standard) 10 GB $0.40
└─ NVIDIA L4 (on-demand) 730 hours $286.18

google_compute_instance.gpu_with_hours
├─ Instance usage (Linux/UNIX, on-demand, n1-standard-16) 100 hours $76.00
├─ Standard provisioned storage (pd-standard) 10 GB $0.40
Expand Down Expand Up @@ -81,17 +86,17 @@
├─ Instance usage (Linux/UNIX, on-demand, f1-micro) 100 hours $0.76
└─ Standard provisioned storage (pd-standard) 10 GB $0.40

OVERALL TOTAL $9,447.04
OVERALL TOTAL $10,249.60
──────────────────────────────────
18 cloud resources were detected:
17 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file
19 cloud resources were detected:
18 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file
∙ 1 is not supported yet, see https://infracost.io/requested-resources:
∙ 1 x google_compute_instance

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Project ┃ Monthly cost ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━┫
┃ TestComputeInstanceGoldenFile ┃ $9,447
┃ TestComputeInstanceGoldenFile ┃ $10,250
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛
Logs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,27 @@ resource "google_compute_instance" "gpu" {
}
}

resource "google_compute_instance" "gpu_l4" {
name = "gpu_l4"
machine_type = "g2-standard-4"
zone = "us-central1-a"

boot_disk {
initialize_params {
image = "centos-cloud/centos-7"
}
}

guest_accelerator {
type = "nvidia-l4"
count = 1
}

network_interface {
network = "default"
}
}

resource "google_compute_instance" "preemptible_gpu" {
name = "preemptible_gpu"
machine_type = "n1-standard-16"
Expand Down
3 changes: 3 additions & 0 deletions internal/resources/google/compute_cost_component_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ func guestAcceleratorCostComponent(region string, purchaseOption string, guestAc
case "nvidia-tesla-a100":
name = "NVIDIA Tesla A100"
descPrefix = "Nvidia Tesla A100 GPU"
case "nvidia-l4":
name = "NVIDIA L4"
descPrefix = "Nvidia L4 GPU"
default:
logging.Logger.Debug().Msgf("skipping cost component because guest_accelerator.type '%s' is not supported", guestAcceleratorType)
return nil
Expand Down

0 comments on commit 5057810

Please sign in to comment.