Results 1 to 7 of 7

Thread: nvidia prime-run

  1. #1
    Join Date
    Dec 2010
    Location
    Mechelen, Belgium
    Posts
    38

    Default nvidia prime-run

    Hello,

    I was just curious to know if, in OpenSUSE, there exists something like "prime-run" as in ArchLinux.
    It is quite easy a tool to choose which GPU you want to use when starting an application. (e.g.: # prime-run steam to start steam and use the nvidia card)

    https://wiki.archlinux.org/index.php...GPU_offloading



  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,855
    Blog Entries
    15

    Default Re: nvidia prime-run

    Quote Originally Posted by thibdb13 View Post
    Hello,

    I was just curious to know if, in OpenSUSE, there exists something like "prime-run" as in ArchLinux.
    It is quite easy a tool to choose which GPU you want to use when starting an application. (e.g.: # prime-run steam to start steam and use the nvidia card)

    https://wiki.archlinux.org/index.php...GPU_offloading


    Hi
    On my dual amd gpu setup I use switcheroo-control for the GNOME DE, or DRI_PRIME=1 from the command line. There is suse-prime, but you need to log out/in https://en.opensuse.org/SDB:NVIDIA_SUSE_Prime
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Dec 2010
    Location
    Mechelen, Belgium
    Posts
    38

    Default Re: nvidia prime-run

    Quote Originally Posted by malcolmlewis View Post
    Hi
    On my dual amd gpu setup I use switcheroo-control for the GNOME DE, or DRI_PRIME=1 from the command line. There is suse-prime, but you need to log out/in https://en.opensuse.org/SDB:NVIDIA_SUSE_Prime
    Thanks for the answer; does switcheroo-control work also on KDE?
    And how can I use DRI_PRIME=1, just write it in a console and put the name of the application I want to start? (e.g. DRI_PRIME=1 steam)

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,855
    Blog Entries
    15

    Default Re: nvidia prime-run

    Quote Originally Posted by thibdb13 View Post
    Thanks for the answer; does switcheroo-control work also on KDE?
    And how can I use DRI_PRIME=1, just write it in a console and put the name of the application I want to start? (e.g. DRI_PRIME=1 steam)
    Hi
    I don't think it works in Plasma... you could modify the default desktop file from /usr/share/applications and copy it to ~/.local/share/applications and call it in the exec line (and rename the name entry).
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Dec 2010
    Location
    Mechelen, Belgium
    Posts
    38

    Default Re: nvidia prime-run

    For those who could be interested, it is possible to use in Tumbleweed (I did not test it yet in Leap) the same method as in Archlinux.
    1. Install the nvidia drivers. (if you do not install them, you can use DRI_PRIME=1 nameoftheapplication to run the nouveau driver for the application in question)
    2. Reboot
    3. Login, open a terminal and then
    $su
    $prime-select intel
    (I do not know whether this is necessary but it cannot hurt)
    4.Logout and login again
    5. Open a terminal and make the following script (copied from Archlinux https://www.archlinux.org/packages/extra/any/nvidia-prime/ )
    $ su
    $ nano prime-run
    Code:
    #!/bin/bash 
    __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"
    
    (and save it)
    $ cp prime-run /bin
    $ cd /bin
    $ chmod 755 prime-run
    $ exit
    6. And now as a user: $ prime-run nameoftheapplication
    7. You can also test if it works with: $ prime-run glxinfo | grep "OpenGL renderer" and you should have something like this: OpenGL renderer string: GeForce GTX 950M/PCIe/SSE2



  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,855
    Blog Entries
    15

    Default Re: nvidia prime-run

    Quote Originally Posted by thibdb13 View Post
    For those who could be interested, it is possible to use in Tumbleweed (I did not test it yet in Leap) the same method as in Archlinux.
    1. Install the nvidia drivers. (if you do not install them, you can use DRI_PRIME=1 nameoftheapplication to run the nouveau driver for the application in question)
    2. Reboot
    3. Login, open a terminal and then
    $su
    $prime-select intel
    (I do not know whether this is necessary but it cannot hurt)
    4.Logout and login again
    5. Open a terminal and make the following script (copied from Archlinux https://www.archlinux.org/packages/extra/any/nvidia-prime/ )
    $ su
    $ nano prime-run
    Code:
    #!/bin/bash 
    __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"
    
    (and save it)
    $ cp prime-run /bin
    $ cd /bin
    $ chmod 755 prime-run
    $ exit
    6. And now as a user: $ prime-run nameoftheapplication
    7. You can also test if it works with: $ prime-run glxinfo | grep "OpenGL renderer" and you should have something like this: OpenGL renderer string: GeForce GTX 950M/PCIe/SSE2


    Hi
    I do the same here, but use an alias instead

    Code:
    xrandr --listproviders | grep NVIDIA
    Provider 1: id: 0x535; cap: 0x2 (Sink Output); crtcs: 4; outputs: 3; associated providers: 1; name: NVIDIA-G1
    Provider 2: id: 0x2d5; cap: 0x2 (Sink Output); crtcs: 4; outputs: 3; associated providers: 1; name: NVIDIA-G0
    
    alias pro0='__NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia '
    alias pro1='__NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G1 __GLX_VENDOR_LIBRARY_NAME=nvidia '
    
    pro0 glxinfo | grep "OpenGL renderer"
    OpenGL renderer string: GeForce GT 710/PCIe/SSE2
    
    pro1 glxinfo | grep "OpenGL renderer"
    OpenGL renderer string: GeForce GT 710/PCIe/SSE2
    More info at: http://download.nvidia.com/XFree86/L...eroffload.html
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7
    Join Date
    Dec 2010
    Location
    Mechelen, Belgium
    Posts
    38

    Default Re: nvidia prime-run

    Quote Originally Posted by thibdb13 View Post
    For those who could be interested, it is possible to use in Tumbleweed (I did not test it yet in Leap) the same method as in Archlinux.
    1. Install the nvidia drivers. (if you do not install them, you can use DRI_PRIME=1 nameoftheapplication to run the nouveau driver for the application in question)
    2. Reboot
    3. Login, open a terminal and then
    $su
    $prime-select intel
    (I do not know whether this is necessary but it cannot hurt)
    4.Logout and login again
    5. Open a terminal and make the following script (copied from Archlinux https://www.archlinux.org/packages/extra/any/nvidia-prime/ )
    $ su
    $ nano prime-run
    Code:
    #!/bin/bash 
    __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"
    
    (and save it)
    $ cp prime-run /bin
    $ cd /bin
    $ chmod 755 prime-run
    $ exit
    6. And now as a user: $ prime-run nameoftheapplication
    7. You can also test if it works with: $ prime-run glxinfo | grep "OpenGL renderer" and you should have something like this: OpenGL renderer string: GeForce GTX 950M/PCIe/SSE2


    Just tested in Leap 15.2 and it also works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •