Featured image of post 【Docker】問題解決:Error response from daemon: Unknown runtime specified nvidia

【Docker】問題解決:Error response from daemon: Unknown runtime specified nvidia

前言

此篇為解決以下問題的過程:

Error response from daemon: Unknown runtime specified nvidia

解法 & 說明

問題發生在我嘗試安裝某個與 container 有關的套件之後,
因為 「/etc/docker/daemon.json」在安裝時被修改過了,
才導致上述的錯誤發生。

還原 /etc/docker/daemon.json

原本的 「etc/docker/daemon.json」 應該存在以下內容,

❯  cat /etc/docker/daemon.json
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

特別注意 “nvidia-container-runtime” 這一段,
我的問題發生在當我安裝了套件之後, “runtimes” 這個 key 整個被洗掉了,
所以才會出現以上的 error。

最後將 json 的內容,補回以上 “runtimes” 的 key 那一段就可以解決了。

Reference