Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces/opengl: Enable parsing of nvidia driver information files #14893

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jocado
Copy link
Contributor

@jocado jocado commented Dec 23, 2024

interfaces/opengl: Enable parsing of nvidia driver information files

Some nvidia hardware companion utilities required access to driver information in order to operate properly, for example nvidia-persistenced. This enables read only access to those files.

Example file content:

/proc/driver/nvidia/gpus/0000\:70\:00.0/information

Model: 		 NVIDIA L4
IRQ:   		 16
GPU UUID: 	 GPU-3291dfa4-fcc4-0110-615b-c894a0d7c689
Video BIOS: 	 95.04.65.00.13
Bus Type: 	 PCIe
DMA Size: 	 47 bits
DMA Mask: 	 0x7fffffffffff
Bus Location: 	 0000:70:00.0
Device Minor: 	 0
GPU Excluded:	 No

/proc/driver/nvidia/capabilities/mig/monitor

DeviceFileMinor: 2
DeviceFileMode: 292
DeviceFileModify: 1

Some nvidia hardware companion utilities required access to driver
information in order to operate properly, for example and nvidia-persistenced.
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.87%. Comparing base (24a0034) to head (f72b80c).
Report is 75 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #14893       +/-   ##
===========================================
+ Coverage   78.20%   95.87%   +17.67%     
===========================================
  Files        1151     1156        +5     
  Lines      151396   801727   +650331     
===========================================
+ Hits       118402   768692   +650290     
- Misses      25662    25685       +23     
- Partials     7332     7350       +18     
Flag Coverage Δ
unittests 95.87% <ø> (+17.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bboozzoo bboozzoo requested a review from zyga January 8, 2025 09:29
@@ -103,6 +103,8 @@ const openglConnectedPlugAppArmor = `
# nvidia
/etc/vdpau_wrapper.cfg r,
@{PROC}/driver/nvidia/params r,
@{PROC}/driver/nvidia/gpus/[0-9]*:[0-9]*:[0-9]*.[0-9]*/information r,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the 'bus location' known to be only pci-like, or would it make sense to use more generic pattern here?

Suggested change
@{PROC}/driver/nvidia/gpus/[0-9]*:[0-9]*:[0-9]*.[0-9]*/information r,
@{PROC}/driver/nvidia/gpus/*/information r,

@@ -103,6 +103,8 @@ const openglConnectedPlugAppArmor = `
# nvidia
/etc/vdpau_wrapper.cfg r,
@{PROC}/driver/nvidia/params r,
@{PROC}/driver/nvidia/gpus/[0-9]*:[0-9]*:[0-9]*.[0-9]*/information r,
@{PROC}/driver/nvidia/capabilities/mig/monitor r,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, what other files are present there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my system I see:

[zyga@ciri ~]$ find /proc/driver/nvidia/ -ls
4026532876      0 dr-xr-xr-x  11 root     root            0 sty  8 08:14 /proc/driver/nvidia/
4026532887      0 dr-xr-xr-x   3 root     root            0 sty  8 08:14 /proc/driver/nvidia/gpus
4026532904      0 dr-xr-xr-x   5 root     root            0 sty  8 08:14 /proc/driver/nvidia/gpus/0000:02:00.0
4026532907      0 -r--r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/gpus/0000:02:00.0/power
4026532906      0 -rw-r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/gpus/0000:02:00.0/registry
4026532905      0 -r--r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/gpus/0000:02:00.0/information
4026532878      0 -r--r--r--   1 root     root            0 sty  8 08:14 /proc/driver/nvidia/params
4026532884      0 dr-xr-xr-x   3 root     root            0 sty  8 11:07 /proc/driver/nvidia/patches
4026532885      0 -r--r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/patches/README
4026532881      0 -rw-r--r--   1 root     root            0 sty  8 08:36 /proc/driver/nvidia/suspend
4026532886      0 -r--r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/version
4026532879      0 -rw-r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/registry
4026532882      0 dr-xr-xr-x   3 root     root            0 sty  8 11:07 /proc/driver/nvidia/warnings
4026532883      0 -r--r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/warnings/README
4026532888      0 dr-xr-xr-x   5 root     root            0 sty  8 08:15 /proc/driver/nvidia/capabilities
4026532900      0 dr-xr-xr-x   4 root     root            0 sty  8 08:15 /proc/driver/nvidia/capabilities/mig
4026532901      0 -r--r--r--   1 root     root            0 sty  8 08:15 /proc/driver/nvidia/capabilities/mig/config
4026532902      0 -r--r--r--   1 root     root            0 sty  8 08:15 /proc/driver/nvidia/capabilities/mig/monitor
4026533128      0 dr-xr-xr-x   3 root     root            0 sty  8 11:07 /proc/driver/nvidia/capabilities/gpu0
4026533129      0 dr-xr-xr-x   2 root     root            0 sty  8 11:07 /proc/driver/nvidia/capabilities/gpu0/mig
4026532903      0 -r--r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/capabilities/fabric-imex-mgmt
4026532880      0 -rw-r--r--   1 root     root            0 sty  8 11:07 /proc/driver/nvidia/suspend_depth

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[zyga@ciri ~]$ cat /proc/driver/nvidia/patches/README
The NVIDIA graphics driver's kernel interface files can be
patched to improve compatibility with new Linux kernels or to
fix bugs in these files. When applied, each official patch
provides a short text file with a short description of itself
in this directory.
[zyga@ciri ~]$ cat /proc/driver/nvidia/warnings/README
The NVIDIA graphics driver tries to detect potential problems
with the host system and warns about them using the system's
logging mechanisms. Important warning message are also logged
to dedicated text files in this directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants