feat(profile): add nvidia-smi.

This commit is contained in:
Alexandre Pujol 2024-07-19 19:23:48 +01:00
parent aaf435ece1
commit 6073dc491f
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,34 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/nvidia-smi
profile nvidia-smi @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nvidia-strict>
@{exec_path} mr,
@{sys}/devices/system/node/ r,
@{sys}/devices/system/node/node@{int}/cpumap r,
@{PROC}/devices r,
@{PROC}/driver/nvidia/capabilities/mig/config r,
@{PROC}/driver/nvidia/capabilities/mig/monitor r,
owner @{PROC}/@{pid}/cmdline r,
/dev/char/@{dynamic}:@{int} w, # For dynamic assignment range 234 to 254, 384 to 511
/dev/nvidia-caps/ rw,
/dev/nvidia-caps/nvidia-cap@{int} r,
/dev/nvidia-uvm rw,
/dev/nvidia-uvm-tools r,
include if exists <local/nvidia-smi>
}
# vim:syntax=apparmor

View File

@ -255,6 +255,7 @@ nmap complain
nmcli complain nmcli complain
nvidia-detector complain nvidia-detector complain
nvidia-persistenced complain nvidia-persistenced complain
nvidia-smi complain
okular complain okular complain
ollama attach_disconnected,complain ollama attach_disconnected,complain
os-prober attach_disconnected,complain os-prober attach_disconnected,complain