nvidia-docker 启动异常 Permission denied 已解决

本文介绍了解决NVIDIA-Docker在SELinux环境下遇到的权限问题的方法。通过临时关闭SELinux(setenforce 0)或永久修改配置文件(/etc/selinux/config),使NVIDIA-Docker能正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决方法:关闭selinux 系统

setenforce 0

原因:nvidia-docker 是docker的一层封装,docker 在root账号下,应用程序安装在/usr/bin/docker 下,linux系统自带的selinux安全机制,为保护系统安全,严格控制调用系统程序的权限,即使在root账号下,也不允许一个系统程序调用另一个系统程序。因此,调用nvidia-docker run/images 等指令,会调用docker 指令,系统提示 权限问题。

解决方法:关闭selinux 安全系统,setenforce 0  临时关闭,系统重启后,恢复启动

如果启动,调用

setenforce 1

查询,selinux 

[root@yj152 /]# getenforce
Enforcing
[root@yj152 /]# 

永久关闭,查看文件 /etc/selinux/config

  1 
  2 # This file controls the state of SELinux on the system.
  3 # SELINUX= can take one of these three values:
  4 #     enforcing - SELinux security policy is enforced.
  5 #     permissive - SELinux prints warnings instead of enforcing.
  6 #     disabled - No SELinux policy is loaded.
  7 SELINUX=enforcing
  8 # SELINUXTYPE= can take one of three two values:
  9 #     targeted - Targeted processes are protected,
 10 #     minimum - Modification of targeted policy. Only selected processes are protected. 
 11 #     mls - Multi Level Security protection.
 12 SELINUXTYPE=targeted
 13 

SELINUX=disabled

保存后,重启 reboot

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值