Base de todo despliegue con GPU · 62 casos
Errores de CUDA y Docker: la GPU no llega al contenedor y la memoria se agota
«could not select device driver», contenedores que no ven la GPU, exit code 137 por OOM y desajustes entre driver, CUDA y PyTorch.
libnvidia-tls.so.470.129.06: no such file or directory)
GitHub · NVIDIA/nvidia-container-toolkit #246
nvidia-container-cli: initialization error)
GitHub · NVIDIA/nvidia-container-toolkit #250
libnvidia-ml.so.1: file exists: unknown)
GitHub · NVIDIA/nvidia-container-toolkit #289
LLVM OpenMP GPU Offloading Docker Image)
Stack Overflow · 0 votos
failed to locate libcuda.so.515.105.01)
GitHub · NVIDIA/nvidia-container-toolkit #82
dxcore initialization failed)
GitHub · NVIDIA/nvidia-container-toolkit #294
CUDA Setup failed despite GPU being available)
GitHub · bitsandbytes-foundation/bitsandbytes #748
libcudart.so not found in any environmental path)
GitHub · bitsandbytes-foundation/bitsandbytes #487
load library failed: libnvidia-ml.so.1)
Stack Overflow · 3 votos
load library failed: libnvidia-ml.so.1)
Stack Overflow · 3 votos
dlerror: libnvinfer.so.7: cannot open shared object file)
Stack Overflow · 28 votos
Unable to find installation candidates for nvidia-cudnn-cu11)
Stack Overflow · 6 votos
load library failed: libnvidia-ml.so.1)
Stack Overflow · 19 votos
cannot get YoloLayer_TRT plugin creator)
Stack Overflow · 0 votos
RuntimeError: Numpy is not available)
Stack Overflow · 47 votos
CUDA error: unspecified launch failure)
GitHub · pytorch/pytorch #27837
Failed call to cuInit: CUDA_ERROR_NOT_INITIALIZED)
Stack Overflow · 4 votos
same CUDA version and driver version)
Stack Overflow · 2 votos
exec: "nvidia-smi": executable file not found in $PATH
Stack Overflow · 0 votos
CUDA error: device-side assert triggered)
Stack Overflow · 95 votos
OCI runtime create failed: container_linux.go:367)
GitHub · NVIDIA/nvidia-docker #1496
RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED)
Stack Overflow · 25 votos
cgroup subsystem devices not found)
GitHub · NVIDIA/nvidia-docker #1447
RuntimeError: CUDA error: invalid device ordinal)
Stack Overflow · 26 votos
Could not load dynamic library 'libcublas.so.10)
Stack Overflow · 32 votos
CUDA error: an illegal memory access was encountered)
GitHub · pytorch/pytorch #21819
OCI runtime create failed: container_linux.go:349)
GitHub · NVIDIA/nvidia-docker #1225
CUDA Version: N/A and torch.cuda.is_available returns False)
Stack Overflow · 22 votos
stop running TensorRT server without using ctrl-c)
Stack Overflow · 0 votos
RuntimeError: expected scalar type Long but found Float)
Stack Overflow · 56 votos
DataLoader worker (pid(s) 15332) exited unexpectedly)
Stack Overflow · 37 votos
Torch not compiled with CUDA enabled)
GitHub · pytorch/pytorch #30664
CUDA out of memory)
Stack Overflow · 194 votos
Input type (torch.FloatTensor) and weight type)
Stack Overflow · 202 votos
Unknown runtime specified nvidia)
Stack Overflow · 27 votos
No module named 'tensorboard.summary)
Stack Overflow · 25 votos
The size of tensor a (4) must match the size of tensor b (3))
Stack Overflow · 45 votos
TypeError: forward() got an unexpected keyword argument 'labels)
Stack Overflow · 26 votos
Target size (torch.Size([16])) must be the same as input size)
Stack Overflow · 49 votos
nvidia-docker on opensuse)
GitHub · NVIDIA/nvidia-docker #657
Expected 4-dimensional input for 4-dimensional weight 32 3 3)
Stack Overflow · 34 votos
ModuleNotFoundError: No module named 'tools.nnwrap)
Stack Overflow · 105 votos
Expected object of scalar type Float but got scalar type Double)
Stack Overflow · 126 votos
RuntimeError: CUDA error: device-side assert triggered)
Stack Overflow · 19 votos
libtorch_python.so: cannot open shared object file)
Stack Overflow · 9 votos
Can't call numpy() on Variable that requires grad)
Stack Overflow · 59 votos
optimizer got an empty parameter list)
Stack Overflow · 32 votos
CUDA out of memory. Tried to allocate 12.50 MiB)
GitHub · pytorch/pytorch #16417
Different CUDA versions shown by nvcc and NVIDIA-smi)
Stack Overflow · 365 votos
timeout limit of nvidia-docker initialization)
Stack Overflow · 0 votos
Cannot re-initialize CUDA in forked subprocess)
Stack Overflow · 40 votos
ImportError: libcublas.so.9.0: cannot open shared object file)
Stack Overflow · 50 votos
Trying to backward through the graph a second time)
Stack Overflow · 58 votos
Torch not compiled with CUDA enabled)
Stack Overflow · 24 votos
nvidia-smi executable file not found)
Stack Overflow · 0 votos
RuntimeError: 1D tensors expected, but got 2D and 2D tensors)
Stack Overflow · 94 votos
Tensorflow cannot open libcuda.so.1)
Stack Overflow · 27 votos
CUDA driver version is insufficient for CUDA runtime version)
Stack Overflow · 35 votos
This executed without error.)
Stack Overflow · 12 votos
ls: cannot access /usr/local/cuda*: No such file or directory)
Stack Overflow · 68 votos
all CUDA-capable devices are busy or unavailable)
Stack Overflow · 35 votos
CUDA driver version is insufficient for CUDA runtime version)
Stack Overflow · 43 votos
Qué falla y por qué
Antes de Ollama, ComfyUI o vLLM está el runtime: el driver de NVIDIA, el toolkit de contenedores y la versión de CUDA con la que se compiló PyTorch. La mitad de los errores que la gente atribuye a una aplicación son en realidad de esta capa, y se reconocen por el mensaje: si habla de «device driver», «nvidia-container» o «kernel image», el problema no está en el modelo.
La otra mitad es memoria. Un contenedor que muere con código 137 lo hizo porque el sistema lo mató al quedarse sin memoria; una GPU que lanza «out of memory» con la tarjeta medio vacía suele tener procesos antiguos que aún retienen memoria. Los dos casos están cubiertos aquí con las comprobaciones que los distinguen.
Con el tiempo la categoría ha crecido hacia dos frentes más. Uno es el toolkit de contenedores de NVIDIA: errores de CDI, de ldcache y de librerías como libnvidia-ml.so que impiden que el contenedor arranque aunque el driver del host esté bien. El otro son los conflictos de dependencias de Python al instalar PyTorch o bitsandbytes: paquetes que se pisan, ruedas compiladas para otra versión de CUDA y avisos de que la librería se instaló sin soporte de GPU.
Preguntas frecuentes
¿Por qué Docker no ve la GPU aunque nvidia-smi funcione en el host?
Porque el contenedor no tiene acceso al dispositivo ni al runtime de NVIDIA: hace falta el toolkit instalado y arrancar el contenedor pidiendo la GPU. Que nvidia-smi funcione en el host solo confirma el driver, no el paso de la GPU al contenedor.
¿Qué significa el código de salida 137?
Que el proceso recibió una señal de terminación tras agotar la memoria del sistema, no la de la GPU. Es un límite de memoria del contenedor o del host; súbelo o reduce el consumo del proceso antes de mirar la tarjeta gráfica.
¿Tengo que instalar CUDA dentro de la imagen?
No en la mayoría de los casos: la imagen trae las librerías de CUDA y el host solo necesita el driver, que se comparte con el contenedor. Instalar un toolkit completo dentro de la imagen suele crear desajustes entre versiones.
Otras categorías
- Ollama — GPU no detectada, «CUDA error: out of memory», modelos que no cargan, puerto 11434 ocupado y problemas de red detrás de proxy.
- ComfyUI — Falta torch o CUDA no coincide, nodos personalizados que no importan, modelos que no aparecen y errores de memoria en la GPU.
- Open WebUI — Docker no resuelve el host, Ollama no aparece en el desplegable, errores de base de datos y volúmenes sin permisos.
- n8n — Webhooks con la URL equivocada, ECONNREFUSED entre contenedores, volúmenes sin permisos, base de datos y clave de cifrado perdida.
- vLLM y llama.cpp — Binarios compilados para otra arquitectura, KV cache que no cabe, GGUF incompatibles y errores de driver al arrancar el servidor.