# CUDA 错误：MPS 服务器未运行 (cudaErrorMpsServerNotReady)

- **ID:** `cuda/cuda-mps-server-unavailable`
- **领域:** cuda
- **类别:** system_error
- **错误码:** `cudaErrorMpsServerNotReady`
- **验证级别:** ai_generated
- **修复率:** 88%

## 根因

CUDA 多进程服务 (MPS) 控制守护进程未运行，但应用程序通过 CUDA_MPS_PIPE_DIRECTORY 或类似环境变量尝试连接到它。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| CUDA 12.4 | active | — | — |
| NVIDIA Driver 550.54.14 | active | — | — |
| Ubuntu 22.04 | active | — | — |

## 解决方案

1. ```
   export CUDA_MPS_PIPE_DIRECTORY=/tmp/nvidia-mps; nvidia-cuda-mps-control -d
   ```
2. ```
   unset CUDA_MPS_PIPE_DIRECTORY; unset CUDA_MPS_LOG_DIRECTORY; python your_script.py
   ```

## 无效尝试

- **** — The daemon must be started explicitly; restarting the app alone does not launch it. (100% 失败率)
- **** — The environment variable only points to the daemon's socket; if the daemon is not running, no path works. (95% 失败率)
