nvidia-installer requires euid == 0 and exits with an error otherwise (misc.c:check_euid()). When building RPM packages in a mock chroot, the build runs as a non-root user (mockbuild). This means packagers have to use fakeroot to satisfy the check, which adds a build dependency and another layer of complexity.
For packaging use cases (where the installer is writing to a buildroot, not the live system), the root check isn't necessary. Would it be possible to add an option like --no-check-root or --skip-root-check to bypass this?
This is already a pattern in the installer, like for example, --skip-module-load and --no-check-for-alternate-installs allow skipping other checks that don't apply during packaging.