chore: auto-commit (95 archivos)
- cmd/fn/doctor.go - cmd/fn/main.go - cpp/apps/primitives_gallery/playground/tables/CMakeLists.txt - cpp/apps/primitives_gallery/playground/tables/data_table.cpp - cpp/apps/primitives_gallery/playground/tables/data_table_logic.cpp - cpp/apps/primitives_gallery/playground/tables/data_table_logic.h - cpp/apps/primitives_gallery/playground/tables/self_test.cpp - cpp/apps/primitives_gallery/playground/tables/tql.cpp - cpp/apps/primitives_gallery/playground/tables/viz.cpp - cpp/apps/primitives_gallery/playground/tables/viz.h - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
---
|
||||
name: cuda_toolkit_check
|
||||
kind: function
|
||||
lang: bash
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "cuda_toolkit_check() -> void"
|
||||
description: "Detecta componentes CUDA instalados en el sistema y emite pares key=value a stdout: nvcc (version o missing), nvidia_smi (present/missing), driver_version, cuda_libs (path o missing) y overall (ok|partial|missing). Exit code 0 siempre — funcion informativa, no fatal."
|
||||
tags: [cuda, nvidia, gpu, hardware, probe, infra, toolkit]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
params:
|
||||
- name: (ninguno)
|
||||
desc: "No toma parametros. Lee el estado del sistema via nvcc, nvidia-smi y busqueda en rutas canonicas de CUDA."
|
||||
output: "Cinco pares key=value en stdout: nvcc, nvidia_smi, driver_version, cuda_libs, overall. overall=ok si los tres componentes principales estan presentes; partial si algunos; missing si ninguno."
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "bash/functions/infra/cuda_toolkit_check.sh"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```bash
|
||||
source bash/functions/infra/cuda_toolkit_check.sh
|
||||
cuda_toolkit_check
|
||||
```
|
||||
|
||||
Salida en maquina con CUDA completo:
|
||||
```
|
||||
nvcc=12.4
|
||||
nvidia_smi=present
|
||||
driver_version=550.54.15
|
||||
cuda_libs=/usr/local/cuda
|
||||
overall=ok
|
||||
```
|
||||
|
||||
Salida en maquina sin CUDA:
|
||||
```
|
||||
nvcc=missing
|
||||
nvidia_smi=missing
|
||||
driver_version=missing
|
||||
cuda_libs=missing
|
||||
overall=missing
|
||||
```
|
||||
|
||||
Invocar directamente:
|
||||
```bash
|
||||
bash bash/functions/infra/cuda_toolkit_check.sh
|
||||
```
|
||||
|
||||
Parsear desde otro script:
|
||||
```bash
|
||||
eval "$(cuda_toolkit_check)"
|
||||
echo "CUDA overall: $overall"
|
||||
if [[ "$overall" == "ok" ]]; then
|
||||
echo "CUDA completo: nvcc=$nvcc driver=$driver_version libs=$cuda_libs"
|
||||
fi
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
- Idempotente: no instala, no modifica nada, solo consulta.
|
||||
- Exit code 0 siempre — ausencia de CUDA es informacion, no fallo.
|
||||
- Busca `libcuda.so` en `/usr/local/cuda*`, `/opt/cuda*` y via `ldconfig -p`.
|
||||
- `driver_version` refleja el driver NVIDIA del kernel, reportado por nvidia-smi.
|
||||
- `nvcc` reporta la version del compilador CUDA toolkit (puede diferir de la version soportada por el driver).
|
||||
- Para obtener la version CUDA maxima soportada por el driver, usar `get_gpu_info_go_infra` (campo CudaVersion del struct GpuInfo).
|
||||
Reference in New Issue
Block a user