@@ -97,17 +97,20 @@ func (m command) build() *cli.Command {
97
97
Name : "config-search-path" ,
98
98
Usage : "Specify the path to search for config files when discovering the entities that should be included in the CDI specification." ,
99
99
Destination : & opts .configSearchPaths ,
100
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CONFIG_SEARCH_PATHS" },
100
101
},
101
102
& cli.StringFlag {
102
103
Name : "output" ,
103
104
Usage : "Specify the file to output the generated CDI specification to. If this is '' the specification is output to STDOUT" ,
104
105
Destination : & opts .output ,
106
+ EnvVars : []string {"NVIDIA_CTK_CDI_OUTPUT_FILE_PATH" },
105
107
},
106
108
& cli.StringFlag {
107
109
Name : "format" ,
108
110
Usage : "The output format for the generated spec [json | yaml]. This overrides the format defined by the output file extension (if specified)." ,
109
111
Value : spec .FormatYAML ,
110
112
Destination : & opts .format ,
113
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_OUTPUT_FORMAT" },
111
114
},
112
115
& cli.StringFlag {
113
116
Name : "mode" ,
@@ -117,27 +120,32 @@ func (m command) build() *cli.Command {
117
120
"If mode is set to 'auto' the mode will be determined based on the system configuration." ,
118
121
Value : string (nvcdi .ModeAuto ),
119
122
Destination : & opts .mode ,
123
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_MODE" },
120
124
},
121
125
& cli.StringFlag {
122
126
Name : "dev-root" ,
123
127
Usage : "Specify the root where `/dev` is located. If this is not specified, the driver-root is assumed." ,
124
128
Destination : & opts .devRoot ,
129
+ EnvVars : []string {"NVIDIA_CTK_DEV_ROOT" },
125
130
},
126
131
& cli.StringSliceFlag {
127
132
Name : "device-name-strategy" ,
128
133
Usage : "Specify the strategy for generating device names. If this is specified multiple times, the devices will be duplicated for each strategy. One of [index | uuid | type-index]" ,
129
134
Value : cli .NewStringSlice (nvcdi .DeviceNameStrategyIndex , nvcdi .DeviceNameStrategyUUID ),
130
135
Destination : & opts .deviceNameStrategies ,
136
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_DEVICE_NAME_STRATEGIES" },
131
137
},
132
138
& cli.StringFlag {
133
139
Name : "driver-root" ,
134
140
Usage : "Specify the NVIDIA GPU driver root to use when discovering the entities that should be included in the CDI specification." ,
135
141
Destination : & opts .driverRoot ,
142
+ EnvVars : []string {"NVIDIA_CTK_DRIVER_ROOT" },
136
143
},
137
144
& cli.StringSliceFlag {
138
145
Name : "library-search-path" ,
139
146
Usage : "Specify the path to search for libraries when discovering the entities that should be included in the CDI specification.\n \t Note: This option only applies to CSV mode." ,
140
147
Destination : & opts .librarySearchPaths ,
148
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_LIBRARY_SEARCH_PATHS" },
141
149
},
142
150
& cli.StringFlag {
143
151
Name : "nvidia-cdi-hook-path" ,
@@ -146,36 +154,42 @@ func (m command) build() *cli.Command {
146
154
"If not specified, the PATH will be searched for `nvidia-cdi-hook`. " +
147
155
"NOTE: That if this is specified as `nvidia-ctk`, the PATH will be searched for `nvidia-ctk` instead." ,
148
156
Destination : & opts .nvidiaCDIHookPath ,
157
+ EnvVars : []string {"NVIDIA_CTK_CDI_HOOK_PATH" },
149
158
},
150
159
& cli.StringFlag {
151
160
Name : "ldconfig-path" ,
152
161
Usage : "Specify the path to use for ldconfig in the generated CDI specification" ,
153
162
Destination : & opts .ldconfigPath ,
163
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_LDCONFIG_PATH" },
154
164
},
155
165
& cli.StringFlag {
156
166
Name : "vendor" ,
157
167
Aliases : []string {"cdi-vendor" },
158
168
Usage : "the vendor string to use for the generated CDI specification." ,
159
169
Value : "nvidia.com" ,
160
170
Destination : & opts .vendor ,
171
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_VENDOR" },
161
172
},
162
173
& cli.StringFlag {
163
174
Name : "class" ,
164
175
Aliases : []string {"cdi-class" },
165
176
Usage : "the class string to use for the generated CDI specification." ,
166
177
Value : "gpu" ,
167
178
Destination : & opts .class ,
179
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CLASS" },
168
180
},
169
181
& cli.StringSliceFlag {
170
182
Name : "csv.file" ,
171
183
Usage : "The path to the list of CSV files to use when generating the CDI specification in CSV mode." ,
172
184
Value : cli .NewStringSlice (csv .DefaultFileList ()... ),
173
185
Destination : & opts .csv .files ,
186
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CSV_FILES" },
174
187
},
175
188
& cli.StringSliceFlag {
176
189
Name : "csv.ignore-pattern" ,
177
190
Usage : "specify a pattern the CSV mount specifications." ,
178
191
Destination : & opts .csv .ignorePatterns ,
192
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_CSV_IGNORE_PATTERNS" },
179
193
},
180
194
& cli.StringSliceFlag {
181
195
Name : "disable-hook" ,
@@ -185,6 +199,7 @@ func (m command) build() *cli.Command {
185
199
"special hook name 'all' can be used ensure that the generated " +
186
200
"CDI specification does not include any hooks." ,
187
201
Destination : & opts .disabledHooks ,
202
+ EnvVars : []string {"NVIDIA_CTK_CDI_GENERATE_DISABLED_HOOKS" },
188
203
},
189
204
}
190
205
0 commit comments