Trouble with nvidia drivers when running as superuser and fast compile options

I am experimenting with the build system to generate optimized binaries; I have tried both with ReleaseFast and ReleaseSafe. It compiles and runs without a problem… The issue is that I’m running the result under an energy profiler, pinpoint, that needs superuser privileges. When I do that, executables fail to run with

terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to initialize nvml: Driver/library version mismatch

I know this is not strictly a zig issue, since apparently there’s a different LD_LIBRARY_PATH or somesuch when it’s run with privileges, but I would appreciate any help on what to exactly look for here.

At any rate, I’m not running any GPU-intensive program, so disabling nvml might be an option.

Restart you computer :slight_smile:

Failed to initialize nvml: Driver/library version mismatch means that the kernel driver and userspace library have different versions. Normally this happens after upgrading software and not restarting to load the newer kernel driver.

2 Likes