interplane.Get Omega
Read in your language

omega-gpu-driver

aien-dev/omega-gpu-driver

Brought by drakestapleton

branch main Branches Tags History

omega-gpu-driver / rm / model.om

150 lines · 2839 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Fixture packed at t3000, 4352 bytes. Prefix HOST_MODEL version1; never device truth.
3note Local vendor routes: nv.c2523 CARD_INFO; gpu_mgr.c2527 ID_INFO_V2;
4note device_ctrl.c56 classlist; gpu.c5036 cached GID. Static GR data originates
5note in rpc76 GSP_RM_CONTROL(INTERNAL_STATIC_KGR_GET_INFO 0x20800a2a),
6note kernel_graphics.c1227, ctrl2080internal.h422, OGKM580.173.02.
7fn rmfx t view ulong 4096 off ulong to uchar
8idx = add 3000 div off 8
9shift = mul rem off 8 8
10v = shr get t idx shift
11ret uchar and v 255
12end
13fn rmfc t view ulong 4096 b edit uchar 16384 dst ulong src ulong n ulong to void
14for j ulong n
15put b add dst j rmfx t add src j
16end
17end
18fn rmfxrpc t view ulong 4096 to bool
19rqinit
20rqpeer
21rqclear 3752
22rqput32 4 8 545262122
23rqput32 4 16 3712
24r = rqsend 76 3752 3752 true
25if ne r 0
26ret false
27end
28for j ulong 4096
29put rqstat add 4096 j rmfx t add 256 j
30end
31rqput32 1 16 1
32if ne rqrecv 1
33ret false
34end
35if or ne get rqfun 0 76 ne get rqres 0 0
36ret false
37end
38if or ne get rqlen 0 3752 ne rqget32 3 88 545262122
39ret false
40end
41ret and eq rqget32 3 96 3712 eq get rqreply 0 ulong 0
42end
43fn rmfload t edit ulong 4096 b edit uchar 16384 to bool
44n = argread 3 b 0 4096
45if or le n 1 ge n 4096
46ret false
47end
48fd = fopen b 0 ulong n 524288 0
49if lt fd 0
50ret false
51end
52pos = ulong 0
53while lt pos 4352 bound 4352
54r = read int fd b pos sub ulong 4352 pos
55if le r 0
56z = fclose int fd
57ret false
58end
59pos = add pos ulong r
60end
61r = read int fd b 4352 1
62z = fclose int fd
63if ne r 0
64ret false
65end
66if or ne rmget b 0 8 ulong 4922237989571219272 ne rmget b 8 8 ulong 674885
67ret false
68end
69for j ulong 544
70put t add 3000 j rmget b mul j 8 8
71end
72ret rmfxrpc t
73end
74fn rmhostct t edit ulong 4096 b edit uchar 16384 a view ulong 8 to ulong
75cmd = get a 2
76slot = rmfind t get a 0 get a 1
77if eq slot 64
78ret 2
79end
80cls = get t add mul slot 5 4
81if eq cmd 517
82if or ne cls 65 ne rmget b 104 4 1
83ret 3
84end
85rmfc t b 104 88 32
86ret 0
87end
88if eq cmd 8389121
89if ne cls 128
90ret 3
91end
92n = rmget b 104 4
93if ne n 0
94if lt n 3
95ret 1
96end
97rmfc t b 120 124 12
98end
99rmput b 104 4 3
100ret 0
101end
102if eq cmd 545264129
103if ne cls 8320
104ret 3
105end
106if ne rmget b 104 4 1
107ret 1
108end
109if ne rmget b 136 4 12
110ret 6
111end
112if not rmfxrpc t
113ret 6
114end
115rmput b 140 4 rqget32 3 220
116ret 0
117end
118if eq cmd 545259850
119if ne cls 8320
120ret 3
121end
122if or ne rmget b 104 4 0 or ne rmget b 108 4 2 lt rmget b 112 4 16
123ret 1
124end
125rmput b 112 4 16
126rmfc t b 116 136 16
127ret 0
128end
129ret 6
130end
131fn rmhostio t view ulong 4096 b edit uchar 16384 nr ulong to long
132if eq nr 200
133for j ulong 4608
134put b add 72 j 0
135end
136rmfc t b 72 16 72
137ret 0
138end
139if eq nr 210
140for j ulong 64
141put b add 80 j 0
142end
143rmput b 76 4 1
144note ogd HOST_MODEL; not NVIDIA version and no vendor compatibility claim.
145rmput b 80 8 6076287493452621679
146rmput b 88 8 3544135292146371935
147ret 0
148end
149ret -95
150end