You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tuned/README.md
+71-1Lines changed: 71 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,11 +145,17 @@ The package expects configmaps to be available in `${SKYHOOK_DIR}/configmaps/`:
145
145
146
146
#### Optional Configmaps
147
147
148
-
- **Custom profile files**: Any other files in the configmaps directory will be treated as custom tuned profile configurations
148
+
- **Custom profile files**: Any files in the configmaps directory (except `tuned_profile` and `*_script` files) will be treated as custom tuned profile configurations
149
149
- File name becomes the profile name
150
150
- File contents become the `tuned.conf` for that profile
151
151
- Files are deployed to `/etc/tuned/<profile_name>/tuned.conf`
152
152
153
+
- **Script files**: Any files ending with `_script` will be deployed as executable scripts to `/etc/tuned/scripts/`
154
+
- File name pattern: `<name>_script` (e.g., `setup_script`, `my_optimization_script`)
155
+
- Scripts are deployed to `/etc/tuned/scripts/<name>` (the `_script` suffix is removed)
156
+
- Scripts are automatically made executable (`chmod +x`)
157
+
- Can be referenced in tuned profiles using the `[script]` plugin
158
+
153
159
### Example Custom Profile
154
160
155
161
```ini
@@ -168,6 +174,49 @@ readahead=4096
168
174
transparent_hugepages=never
169
175
```
170
176
177
+
### Example Custom Profile with Scripts
178
+
179
+
```ini
180
+
# configmaps/ai-optimized-profile
181
+
[main]
182
+
summary=AI/ML optimized profile with custom scripts
183
+
184
+
[cpu]
185
+
governor=performance
186
+
energy_perf_bias=performance
187
+
188
+
[script]
189
+
type=script
190
+
script=/etc/tuned/scripts/ai_setup
191
+
192
+
[vm]
193
+
transparent_hugepages=always
194
+
```
195
+
196
+
```bash
197
+
# configmaps/ai_setup_script
198
+
#!/bin/bash
199
+
# This script will be deployed to /etc/tuned/scripts/ai_setup
200
+
201
+
echo"Setting up AI/ML optimizations..."
202
+
203
+
# Configure GPU memory settings
204
+
if [ -d /sys/class/drm ];then
205
+
echo"Configuring GPU settings for AI workloads"
206
+
# Add GPU-specific optimizations here
207
+
fi
208
+
209
+
# Set up NUMA topology optimizations
210
+
echo"Configuring NUMA settings for AI workloads"
211
+
fornodein /sys/devices/system/node/node*;do
212
+
if [ -d"$node" ];then
213
+
echo 0 >"$node/compact"
214
+
fi
215
+
done
216
+
217
+
echo"AI optimization setup complete"
218
+
```
219
+
171
220
## Usage Examples
172
221
173
222
### Basic Installation
@@ -223,6 +272,9 @@ spec:
223
272
224
273
[bootloader]
225
274
cmdline_myprofile=-kernel.panic +kernel.panic=20
275
+
276
+
[script]
277
+
script=/etc/tuned/scripts/ai_init
226
278
custom_profile_1: |-
227
279
[main]
228
280
summary=AI/ML performance profile
@@ -238,13 +290,31 @@ spec:
238
290
[vm]
239
291
transparent_hugepages=always # large pages help with tensor allocations
240
292
swappiness=10 # avoid swapping under load
293
+
ai_init_script: |-
294
+
#!/bin/bash
295
+
# Custom AI/ML initialization script
296
+
echo "Initializing AI/ML optimizations..."
297
+
298
+
# Configure GPU memory pools
299
+
if command -v nvidia-smi >/dev/null 2>&1; then
300
+
echo "Configuring NVIDIA GPU settings"
301
+
nvidia-smi -pm 1 # Enable persistence mode
302
+
fi
303
+
304
+
# Set up memory allocation patterns for AI workloads
305
+
echo "Configuring memory allocation for AI workloads"
306
+
echo 1 > /proc/sys/vm/overcommit_memory
307
+
308
+
echo "AI initialization complete"
241
309
```
242
310
243
311
This example demonstrates:
244
312
- **Node targeting**: Using `nodeSelectors` to target specific node groups
245
313
- **Interrupt handling**: Configuring reboot interrupts for kernel-level changes
246
314
- **Environment variables**: Setting `INTERRUPT=true` to handle verification during config changes
247
315
- **Custom profiles**: Creating hierarchical profiles with `include` directive
316
+
- **Custom scripts**: Using `_script` configmaps to deploy executable scripts
317
+
- **Script integration**: Referencing deployed scripts in profiles using the `[script]` plugin
248
318
- **AI/ML optimizations**: Performance settings optimized for machine learning workloads
249
319
- **Kernel parameters**: Using `[sysctl]` and `[bootloader]` sections for low-level tuning
0 commit comments