Skip to content

Commit

Permalink
interfaces/bulitin/opengl: add support for cuda workloads on Tegra iG…
Browse files Browse the repository at this point in the history
…PU in opengl interface (canonical#14536)

undefined
  • Loading branch information
DocSepp authored Oct 3, 2024
1 parent f51a4e1 commit 9a82ad9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions interfaces/builtin/opengl.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ unix (bind,listen) type=seqpacket addr="@cuda-uvmfd-[0-9a-f]*",
# From https://bugs.launchpad.net/snapd/+bug/1862832
/run/nvidia-xdriver-* rw,
unix (send, receive) type=dgram peer=(addr="@var/run/nvidia-xdriver-*"),
/dev/nvgpu/igpu[0-9]*/power rw,
/dev/nvgpu/igpu[0-9]*/ctrl rw,
/dev/nvgpu/igpu[0-9]*/prof rw,
/dev/host1x-fence rw,
`

type openglInterface struct {
Expand All @@ -211,6 +216,14 @@ var openglConnectedPlugUDev = []string{
`KERNEL=="mali[0-9]*"`,
`KERNEL=="dma_buf_te"`,
`KERNEL=="galcore"`,

//iGPU device nodes
`SUBSYSTEM=="nvidia-gpu-v2-power" KERNEL=="power"`,
`SUBSYSTEM=="nvidia-gpu-v2" KERNEL=="ctrl"`,
`SUBSYSTEM=="nvidia-gpu-v2" KERNEL=="prof"`,

// Nvidia dma barrier
`SUBSYSTEM=="host1x-fence"`,
}

// Those two are the same, but in theory they are separate and can move (or
Expand Down
2 changes: 1 addition & 1 deletion interfaces/builtin/opengl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (s *OpenglInterfaceSuite) TestUDevSpec(c *C) {
c.Assert(err, IsNil)
spec := udev.NewSpecification(appSet)
c.Assert(spec.AddConnectedPlug(s.iface, s.plug, s.slot), IsNil)
c.Assert(spec.Snippets(), HasLen, 15)
c.Assert(spec.Snippets(), HasLen, 19)
c.Assert(spec.Snippets(), testutil.Contains, `# opengl
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="snap_consumer_app"`)
c.Assert(spec.Snippets(), testutil.Contains, `# opengl
Expand Down

0 comments on commit 9a82ad9

Please sign in to comment.