Ubuntu非LTS版本安装nvidia-docker出错:Unsupported distribution!

问题:

按照Nvidia官方流程,在Ubuntu22.10安装nvidia-docker在执行以下命令时

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

出错:

Unsupported distribution!

分析解决:

查看Nvidia官方说明支持的系统说明,发现对于Ubuntu系统默认是只支持LTS版本,即*.04,

Ubuntu非LTS版本安装nvidia-docker出错:Unsupported distribution!_第1张图片

因此使用非该类版本时需要指定为改版本,例如系统是22.10,上面的命令要指定distribution="ubuntu22.04",命令具体而言变为:

distribution="ubuntu22.04" && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

你可能感兴趣的:(Linux,docker,ubuntu,linux)