isNvidiaModuleLoaded checks if NVIDIA kernel module is already loaded in kernel memory.
()
| 927 | |
| 928 | // isNvidiaModuleLoaded checks if NVIDIA kernel module is already loaded in kernel memory. |
| 929 | func isNvidiaModuleLoaded() bool { |
| 930 | // Check if the nvidia module is loaded by checking if nvidiaModuleRefcntPath exists |
| 931 | if _, err := os.Stat(nvidiaModuleRefcntPath); err == nil { |
| 932 | refcntData, err := os.ReadFile(nvidiaModuleRefcntPath) |
| 933 | if err == nil { |
| 934 | refcnt := strings.TrimSpace(string(refcntData)) |
| 935 | log.Infof("NVIDIA kernel module already loaded in kernel memory (refcnt=%s)", refcnt) |
| 936 | return true |
| 937 | } |
| 938 | } |
| 939 | return false |
| 940 | } |
| 941 | |
| 942 | // createDevCharSymlinks creates symlinks in /host-dev-char that point to all possible NVIDIA devices nodes. |
| 943 | func createDevCharSymlinks(driverInfo driverInfo, disableDevCharSymlinkCreation bool) error { |
no outgoing calls
no test coverage detected