interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / gpu / nvidia / native / smi / util.om

49 lines · 1556 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note util.om: the one cudapp-smi control whose params exceed native/nvrm/context.om's 16384-byte nvpar.
3note Appended after context.om and before rm.om. The control header goes through context.om's nvhdr;
4note the params live in smbig. Layout: open-gpu-kernel-modules 580.173.02 (commit 20e4e6e1),
5note src/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080perf.h:447-592 and ctrl2080gpumon.h:40.
6note 545267862 NV2080_CTRL_CMD_PERF_GET_GPUMON_PERFMON_UTIL_SAMPLES_V2 0x20802096, 55888-byte params:
7note type u8 @0, bufSize u32 @4, count u32 @8, tracker u32 @12, 72 samples of 776 bytes @16.
8note devcall with 55888 bytes needs the devcall bound of aien-dev/omega-mv#1042 (draft PR #1048):
9note omc e5b32567 traps 3 above 16383 bytes, so this unit is pinned to the #1048 candidate compiler.
10
11global smbig uchar 55888
12
13fn sbzero to void
14for i ulong len smbig
15put smbig i 0
16end
17end
18
19fn sbput off ulong v uint to void
20for i ulong 4
21put smbig add off i uchar and shr v mul i 8 255
22end
23end
24
25fn sbget off ulong to uint
26v = uint 0
27for i ulong 4
28v = or v shl uint get smbig add off i mul i 8
29end
30ret v
31end
32
33fn sbg64 off ulong to ulong
34v = ulong 0
35for i ulong 8
36v = or v shl ulong get smbig add off i mul i 8
37end
38ret v
39end
40
41note Subdevice control with smbig as params; result as nvctrl (false: nverr or the status at header 28).
42fn nvbig cmd uint n ulong to bool
43nhzero
44nhput 0 get nvobj 0
45nhput 4 get nvobj 2
46nhput 8 cmd
47r = devcall get nvfd 0 uint 3223340586 nvhdr 0 32 smbig 0 n
48ret nvos r nhget 28
49end