# Copyright 2026 NVIDIA CORPORATION
# SPDX-License-Identifier: Apache-2.0
#
# GPU Operator values for the nvml-mock "with GPU Operator" demo.
#
# Provenance, stated precisely because it is easy to overclaim:
#
#   - This file was copied from tests/e2e/gpu-operator-values.yaml. Strip the
#     comments from both and they are identical.
#   - CI does NOT install either of them. The e2e-gpu-operator job runs
#     `tilt ci -- --gpu-operator`, and local/gpu-operator/gpu_operator.tiltfile
#     passes local/gpu-operator/gpu-operator.values.yaml. That is a third copy.
#   - Strip the comments from that third copy too and it is identical to this
#     one, so the configuration below is the configuration CI exercises, but
#     the FILE below is not the file CI reads, and no test, lint or hook keeps
#     the three in step. If you change a value here, change it in the other
#     two as well.
#
# Prerequisites:
#   - the nvml-mock chart already installed (it stages the mock NVML and CUDA
#     libraries and labels the node nvidia.com/gpu.present=true)
#   - containerd on every node in CDI mode with the nvidia runtime handler
#     registered; see the demo README for how to get a cluster like that

# Driver is replaced by nvml-mock chart — no real kernel module needed.
driver:
  enabled: false

# Container toolkit is not needed — the mock libs are placed on the host
# by the nvml-mock DaemonSet, not injected by the toolkit.
toolkit:
  enabled: false

# Standalone nv-hostengine DaemonSet is not needed: dcgm-exporter embeds the
# host engine in-process (libdcgm loads the mock NVML like any other consumer).
dcgm:
  enabled: false

# dcgm-exporter runs against the mock NVML: DEV metrics come from the standard
# telemetry getters/field values, PROF metrics (DCGM_FI_PROF_*) from the mock
# GPM implementation on Hopper+ profiles (see pkg/gpu/mocknvml/engine/gpm.go).
dcgmExporter:
  enabled: true
  env:
    - name: NVIDIA_DRIVER_ROOT
      value: "/var/lib/nvml-mock/driver"
    - name: DCGM_EXPORTER_COLLECT_INTERVAL
      value: "5000"

# MIG is not supported by the mock NVML — disable manager and set strategy to none.
# Without this, the device-plugin enumerates MIG devices and the CDI spec generator
# treats any non-NOT_FOUND return as fatal (the mock now returns NOT_FOUND).
mig:
  strategy: none
migManager:
  enabled: false

# Node status exporter is untested with the mock — keep disabled for now
# (dcgm-exporter itself works; see dcgmExporter above).
nodeStatusExporter:
  enabled: false

# CDI mode — the toolkit reads /var/run/cdi/nvidia.yaml generated by nvml-mock.
cdi:
  enabled: true
  default: true

# Device plugin discovers GPUs via mock NVML.
devicePlugin:
  enabled: true
  config:
    name: ""
  env:
    - name: NVIDIA_DRIVER_ROOT
      value: "/var/lib/nvml-mock/driver"

# GFD reads GPU attributes via mock NVML and labels the node.
#
# GFD_MACHINE_TYPE_FILE is needed because this demo drives the CDI path, where
# the toolkit resolving nvidia.com/gpu applies the spec's mounts and drops its
# env (#747). Without it GFD falls back to the host's DMI product file and
# labels the node with the host's machine type instead of the simulated one.
# The NRI path injects this variable itself, so a demo using nri.enabled would
# not need the override.
gfd:
  enabled: true
  env:
    - name: NVIDIA_DRIVER_ROOT
      value: "/var/lib/nvml-mock/driver"
    - name: GFD_MACHINE_TYPE_FILE
      value: "/etc/nvml-mock/machine-type"

# Validator checks that the GPU stack is functional.
# driver-validation: mounts hostPath /run/nvidia/driver → our mock (via symlink).
# toolkit-validation: CDI injection makes nvidia-smi available inside containers.
# cuda-validation: WITH_WORKLOAD=false skips vectorAdd (kernel launch is a no-op).
# plugin-validation: checks nvidia.com/gpu in node allocatable.
validator:
  driver:
    env:
      - name: DRIVER_INSTALL_DIR
        value: "/run/nvidia/driver"
      - name: LD_LIBRARY_PATH
        value: "/run/nvidia/driver/usr/lib64"
      - name: DISABLE_DEV_CHAR_SYMLINK_CREATION
        value: "true"
  toolkit:
    env:
      - name: NVIDIA_VISIBLE_DEVICES
        value: "all"
  cuda:
    env:
      - name: WITH_WORKLOAD
        value: "false"
  plugin:
    env:
      - name: LD_LIBRARY_PATH
        value: "/run/nvidia/driver/usr/lib64"
