• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / nvrc / 20757892936

06 Jan 2026 06:23PM UTC coverage: 90.325% (+0.2%) from 90.137%
20757892936

Pull #89

github

web-flow
Merge 1be313cbe into 8678496dc
Pull Request #89: Improve Coverage

15 of 17 new or added lines in 6 files covered. (88.24%)

24 existing lines in 4 files now uncovered.

1251 of 1385 relevant lines covered (90.32%)

8.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.0
/src/modprobe.rs
1
use crate::execute::foreground;
2
use anyhow::Result;
3

4
const MODPROBE: &str = "/sbin/modprobe";
5

6
/// Load a kernel module via modprobe.
7
/// Used to load GPU drivers (nvidia, nvidia-uvm) during init.
8
pub fn load(module: &str) -> Result<()> {
4✔
9
    foreground(MODPROBE, &[module])
4✔
10
}
4✔
11

12
/// Reload NVIDIA modules to pick up configuration changes.
13
/// Used after nvidia-smi adjusts GPU settings (clocks, power limits)
14
/// that require a module reload to take effect.
15
pub fn reload_nvidia_modules() -> Result<()> {
2✔
16
    foreground(MODPROBE, &["-r", "nvidia-uvm", "nvidia"])?;
2✔
17
    load("nvidia")?;
×
18
    load("nvidia-uvm")
×
19
}
2✔
20

21
#[cfg(test)]
22
mod tests {
23
    use super::*;
24
    use crate::test_utils::require_root;
25
    use serial_test::serial;
26

27
    // Kernel module loading must be serialized - parallel modprobe
28
    // calls can race and cause spurious failures.
29

30
    #[test]
31
    #[serial]
32
    fn test_load_loop() {
2✔
33
        require_root();
2✔
34
        // 'loop' module is almost always available (loop devices)
35
        assert!(load("loop").is_ok());
2✔
36
    }
37

38
    #[test]
39
    #[serial]
40
    fn test_load_nonexistent() {
2✔
41
        require_root();
2✔
42
        let err = load("nonexistent_module_xyz123").unwrap_err();
2✔
43
        // modprobe exits non-zero for missing modules
44
        assert!(
2✔
45
            err.to_string().contains("modprobe"),
2✔
UNCOV
46
            "error should mention modprobe: {}",
×
47
            err
48
        );
49
    }
50

51
    #[test]
52
    #[serial]
53
    fn test_reload_fails_without_hardware() {
2✔
54
        require_root();
2✔
55
        // Will fail: no nvidia modules on systems without NVIDIA
56
        let _ = reload_nvidia_modules();
2✔
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc