Commit c7ced61
authored
Make dynamic link functions optional and include more error context (#22)
On recent Intel drivers the `Igcl` object failed to be created. As it
turns out the most recent Intel drivers deleted these functions:
ctlEnumerateMuxDevices: Err(
GetProcAddress {
source: Os {
code: 127,
kind: Uncategorized,
message: "The specified procedure could not be found.",
},
},
),
ctlGetMuxProperties: Err(
GetProcAddress {
source: Os {
code: 127,
kind: Uncategorized,
message: "The specified procedure could not be found.",
},
},
),
ctlSwitchMux: Err(
GetProcAddress {
source: Os {
code: 127,
kind: Uncategorized,
message: "The specified procedure could not be found.",
},
},
),
This matches their removal from the header in the most recent `v268`
release: intel/drivers.gpu.control-library#139
While we could just bump and regenerate the crate on that version (see
the other PR), that would suddenly require all other newer functions to
be present too which may only be the case on relatively new drivers. To
err on the side of caution, make function loading optional in "favour"
of panicking at runtime if a symbol was missing (where it is unlikely
that most existing used functions are deleted to retain backwards
compatibility).
Also include better error messages to understand where the error is
originating from, and add a simple runnable example to confirm that it's
working again directly from this repository.1 parent 354f9af commit c7ced61
File tree
5 files changed
+1303
-669
lines changed- api_gen/src
- examples
- src
5 files changed
+1303
-669
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
0 commit comments