Cldfire / nvml-wrapper

Safe Rust wrapper for the NVIDIA Management Library
Apache License 2.0
134 stars 32 forks source link

Cannot call legacy functions #46

Closed lharri73 closed 1 year ago

lharri73 commented 1 year ago

device_count() panics with value: FailedToLoadSymbol("/lib64/libnvidia-ml.so: undefined symbol: nvmlDeviceGetComputeRunningProcesses_v3")

nvml_wrapper version: 0.9.0 (with legacy-functions feature) nvidia driver version: 470.161.03

Is something else required to call the v2 version of this function?

TheElectronWill commented 1 year ago

edit: nevermind, I didn't see that you've already enabled the legacy-functions feature :sweat_smile: It's weird then. Maybe you can call the right version directly from nvml-wrapper-sys?

Cldfire commented 1 year ago

@lharri73 Nvml.device_count() is implemented as:

    pub fn device_count(&self) -> Result<u32, NvmlError> {
        let sym = nvml_sym(self.lib.nvmlDeviceGetCount_v2.as_ref())?;

        unsafe {
            let mut count: c_uint = mem::zeroed();
            nvml_try(sym(&mut count))?;

            Ok(count)
        }
    }

Meaning it is already trying to call the v2 version of the function (self.lib.nvmlDeviceGetCount_v2).

The error you shared implies you were trying to call Device.running_compute_processes(). Can you clarify what you were calling here and share a bit of your code please? 🙂

Cldfire commented 1 year ago

Closing for inactivity. If you're still having issues feel free to comment 🙂