forked from NVIDIA/nvidia-container-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nvidia-container.te
29 lines (18 loc) · 883 Bytes
/
nvidia-container.te
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# /usr/share/selinux/devel/include
policy_module(nvidia-container, 0.1)
gen_require(`
type container_runtime_tmpfs_t;
type xserver_exec_t;
')
container_domain_template(nvidia_container)
# --- hanging forever without this
allow nvidia_container_t container_runtime_t:process sigchld;
# --- podman/docker
getattr_dirs_pattern(nvidia_container_t, container_runtime_tmpfs_t, container_runtime_tmpfs_t)
list_dirs_pattern(nvidia_container_t, container_runtime_tmpfs_t, container_runtime_tmpfs_t)
read_files_pattern(nvidia_container_t, container_runtime_tmpfs_t, container_runtime_tmpfs_t)
# --- running nvidia-smi
allow nvidia_container_t xserver_exec_t:file { entrypoint execute getattr };
# --- allow nvidia_container_t xserver_misc_device_t:chr_file { getattr ioctl open read write };
# --- alloc mem, ... /dev/nvidia*
dev_rw_xserver_misc(nvidia_container_t)