Request for prime-run

Arch has a package that is usually installed with the nVidia driver. It is a script that adds variables to use Prime Offload to run a program with a discrete GPU. Can someone please package it and add it to the OM repositories?
Here is its code:

#!/bin/bash
 __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"

Please submit a Package request providing all the informations needed.

:+1: https://github.com/OpenMandrivaAssociation/distribution/issues/3264

We already package envycontrol which serves the same/similar purpose as far as I understand including prime render offloading as per the graphics modes described in its readme:

Further down their readme it also links to GUI widgets for KDE and Gnome.

It doesn’t have full support for Wayland yet. And I didn’t find the function with Prime Offload program launching there.

In the envycontrol wiki FAQ page in the hybrid section it describes how to launch commands with dGPU on demand which may be what you are looking for:

https://github.com/bayasdev/envycontrol/wiki/Frequently-Asked-Questions#hybrid

As for Wayland and envycontrol you will have to look through upstream issues to investigate about that: https://github.com/bayasdev/envycontrol/issues?q=wayland

I dont have Nvidia laptop to test any of this with.

As for the package request on github no URL to a source tarball or link to a source repository has been provided, zipped packages built for other distributions are not acceptable as we have no way of verifying their source or authenticity.

We are not against packaging requested software, but we need the real sources to do that.

1 Like

Upon further investigation the so called nvidia-prime is only a bash script that inserts the flags linked to in the envycontrol wiki hybrid section to launch a program with:

This is the default behavior for both Nvidia and nouveau drivers, the dGPU can be accesed on-demand with DRI_PRIME=1 <command> for nouveau or __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia <command> for the propietary driver.

#!/bin/bash
__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"

Will discuss how to package that with other maintainers, whether standalone or otherwise.

3 Likes

After locating the upstream source repository for the script I have created a package for it.

nvidia-prime package containing prime-run is available in the cooker/non-free repos.

4 Likes

Thanks for uploading it. It’s strange that you didn’t do it earlier, I thought it was already there. Since other distributions have had it for a long time. It’s just a thing that allows you to use dGPU, without the hassle of manually flagging or installing the script, but so that the shell knows it. Basically it just makes it easier to use GPUs in dual graphics laptops.