@@ -19,15 +19,17 @@ pub const Command = enum {
1919 reset ,
2020 cfg ,
2121 applycfg ,
22+ info ,
2223};
2324
24- // for internal use, mapped from SubCommands
25+ // for internal use, mapped from Commands
2526pub const Op = enum {
2627 query ,
2728 set ,
2829 reset ,
2930 showcfg ,
3031 applycfg ,
32+ info ,
3133 noop ,
3234};
3335
@@ -37,6 +39,7 @@ pub const Parsed = union(Op) {
3739 reset : ResetHandler ,
3840 showcfg : ConfigOption ,
3941 applycfg : ConfigOption ,
42+ info ,
4043 noop ,
4144};
4245
@@ -48,7 +51,6 @@ pub const CliQueryProperty = enum {
4851 gpu , // all info about a GPU
4952 gn ,
5053 gpun , // GPUs number
51- driver , // NVIDIA driver version
5254 ps , // supported P-states list
5355 pstates ,
5456 psc , // GPU/MEM clocks and offsets
@@ -64,7 +66,6 @@ pub const CliQueryProperty = enum {
6466 return switch (self ) {
6567 .gpu = > .gpu ,
6668 .gn , .gpun = > .gpu_num ,
67- .driver = > .driver ,
6869 .ps , .pstates = > .pstates ,
6970 .psc , .pstateclk = > .pstate_clock ,
7071 .w , .pl = > .power_limit ,
@@ -119,6 +120,7 @@ const main_help =
119120 \\ reset Reset gpu settings to default (root required)
120121 \\ cfg Print config file
121122 \\ applycfg Apply settings from config file (root required)
123+ \\ info Print driver, NVML version and detected GPUs
122124 \\
123125 \\Options:
124126 \\ -h, --help Print help
@@ -188,6 +190,7 @@ pub fn cli(args: std.process.Args, io: std.Io, gpa: std.mem.Allocator) !Parsed {
188190 .reset = > try reset (io , gpa , & iter ),
189191 .cfg = > try config_commands (.showcfg , io , gpa , & iter , showcfg_help ),
190192 .applycfg = > try config_commands (.applycfg , io , gpa , & iter , applycfg_help ),
193+ .info = > .info ,
191194 };
192195}
193196
@@ -201,7 +204,6 @@ fn get(io: std.Io, gpa: std.mem.Allocator, iter: *std.process.Args.Iterator) !Pa
201204 \\ <QUERY> Possible values:
202205 \\ gpu Print gpu info
203206 \\ gn, gpun Print the number of gpus present on the system
204- \\ driver Print NVIDIA driver version
205207 \\ ps, pstates Print supported P-states list
206208 \\ psc, pstateclk Print all P-states clocks and offsets
207209 \\ w, pl Print power limit
0 commit comments