Linux run on gpu

How can I force all applications to run on/permanently enable discrete GPU with open source drivers?

System: KDE Neon 18.04, 4.18 kernel Integrated: Intel HD Discrete: Nvidia 965M Drivers: nouveau I have gotten it to work with Nvidia’s proprietary drivers, but I am trying out Wayland and would like to stick with it. The problem is that Nvidia’s proprietary source means Wayland can’t develop a seamless way to integrate Nvidia drivers. I’d really love to get away from xorg and Nvidia software usage because they’ve been a huge pain. I can use X.org with my discrete GPU, but can only (most of the time) use Wayland with my integrated GPU. I say most of the time because I haven’t actually seen it switch to using my discrete GPU with either desktop manager but the RAM I save/performance boost is very noticeable when forcing everything to run off the discrete GPU. I know that applications that render 3D gfx heavily are able to switch off, but the ability to do it well is hampered by Intel HD Graphics deciding to use a lot more RAM. The main applications I’d like to force run on my discrete are browsers and GUI shell. Things I’ve tried in the order presented: Purged anything nvidia Reinstalled any nouveau related packages in case it was related to upgrading the kernel Installed nvidia-prime by itself and using command prime-select nvidia Looked if my discrete was known by my system with switcheroo-control ; not really sure what this does without any BIOS settings to help. Partial output of gdbus introspect —system —dest net.hadess.SwitcherooControl —object-path :

interface net.hadess.SwitcherooControl < methods: signals: properties: readonly b HasDualGpu = true; 

Removed nouveau.modeset=0 and replaced it with nvidia-drm.modeset=1 . I previously used the prior to allow myself to boot into login without system hang and the latter option was suggested as such from here. What I haven't tried from that guide is sudo ubuntu-drivers autoinstall , which I will try now. I've been hesitant to try it because of all the packages it installs.

libbsd0:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libffi6:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libllvm7:i386 libnvidia-cfg1-390 libnvidia-common-390 libnvidia-compute-390 libnvidia-compute-390:i386 libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390 libnvidia-encode-390:i386 libnvidia-fbc1-390 libnvidia-fbc1-390:i386 libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390 libnvidia-ifr1-390:i386 libpciaccess0:i386 libsensors4:i386 libstdc++6:i386 libwayland-client0:i386 libwayland-server0:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxnvctrl0 libxshmfence1:i386 libxxf86vm1:i386 nvidia-compute-utils-390 nvidia-dkms-390 nvidia-driver-390 nvidia-kernel-common-390 nvidia-kernel-source-390 nvidia-settings nvidia-utils-390 screen-resolution-extra xserver-xorg-video-nvidia-390 

I've now rebooted into Wayland. My 3D processor calls for Nvidia but the main GPU being used is still Intel. nvidia-smi prints out that 30MB is being used for /usr/lib/xorg/Xorg . I've put nvidia-smi -pm 1 and will reboot to test. I don't think it will help. If it does I will re-edit but I'm going to put this for rest until someone with more experience can help. Normally I would use nvidia-settings to force discrete but it outputs ERROR: Unable to find display on any available system . Edit: I reisub'd after I my system hanged on restarting. Logged in regular shell, checked GPU RAM usage with nvidia-smi and multiple processes are rendered with GPU instead of just 1. I was able to use nvidia-settings and double checked that Nvidia/performance was selected as the preferred mode. One of the many, many reasons I switched to Wayland is that I wasn't able to extend monitors one day. My 2nd monitor always stays as a duplicate. still not fixed, and now my panels are all missing. Logged out, logged back into Wayland session and nvidia-smi only shows Xorg as the process being rendered through Nvidia GPU. I really, really need to use a virtual OS for testing this kind of stuff.

Читайте также:  Kali linux сброс пароля windows 10

Источник

choose which GPU to use for each application

bumblebee applications settings

I am Ubuntu 14.04 and have NVIDIA graphics card 820m running with driver v331. On windows we can select which GPU to use to run a application. How can we do it on Ubuntu? UPDATE:
my question was marked duplicate of this answer, which didnt helped

  1. in Bumblebee Application Setting program, I set few application to be run on Performance Mode but it get reset to Unrecognized after I close the application (see image below)
  2. Previously the Graphic in System Settings > Details used to be Nvidia but it is not Intel Haswell, which means nvidia is not being used :-/

Ubuntu system settings Details

@dobey previously after selecting nvidia proprietary drivers from additional drivers, Graphics used to be nvidia in System settings > Details, but now it is intel haswell. its not using nvidia what to do?

3 Answers 3

The current version of nvidia-prime uses one graphics card for the complete desktop. You either login with nvidia or intel.

I have had problems with bumblebee since 13.10. What works for me now is nvidia-prime. This allows you to choose which graphics driver you want to use in the nvidia control panel. This only works with lightdm (unity). I'm using this myself on Ubuntu 14.04

How to install

1. Use nvidia driver

Open the dash (super/windows key) and type in "drivers". Open "Aditional drivers" Select the nvidia binary (331.xx) driver.

nvidia driver

Click "apply changes". Wait for the driver to be downloaded and installed, and click close.

2. Remove bumblebee and install prime

Open the shell by pressing ctrl-alt-t.

Читайте также:  Как установить pkg в linux

First let's make sure we have the latest software catalog.

Now remove everything bumblebee related.

sudo apt-get purge bumblebee* 
sudo apt-get install nvidia-prime 

Now restart your computer.

How to use prime

After your computer has restarted, open the dash and type "nvidia". Open "Nvidia x-server settings".

choose between Intel and nvidia

Here you can choose between the intel and nvidia graphics driver. Choose the intel one for maximum power saving, choose the nvidia one for maximum performance.

After changing graphics card, you'll have to logout and log back in to apply the changes.

Difference between nvidia-prime and bumblebee

The current version of nvidia-prime uses one graphics card for the complete desktop. You either login with nvidia or intel. With bumblebee, you can start individual programs with a specific graphics card, like it is the case on windows.

Sadly, I can't get bumblebee to work on ubuntu 13.10 or higher.

using one GPU per session kinda sucks. Isn't there any way to make it switch dinamically, similar to how it works on windows?

@Burdu I know on windows its possible, windows has bigger market share than linux, so nvidia spends more money on making better drivers for windows. as i told from 13.10 onwards we have to use prime drivers for linux, if you have battery or heating issue you can use nvidia in power saver mode.

If you want to select a specific GPU for the entire session, then selecting it with Prime, logging out and then logging back in will suffice.

However, if you really want to choose which GPU to use for each application, then you must use the DRI_PRIME environment variable for such specific application(s) instead of using the system-wide Prime setting.

Ideally, it's recommended to use the Prime program in order to preset the integrated GPU (graphics processing unit) as the default (system-wide) one, i.e. it's recommended to set the integrated Intel graphics card as the default one, because it saves power, helps keeping your computer operating at a lower temperature et cetera. Then when you decide to run that very demanding 3D appplication, you use DRI_PRIME to tell the system that it must use your Nvidia GPU to run such specific application.

Читайте также:  Посмотреть активные порты linux

As explained e.g. here and here, once you've used Prime to "tell" the system that your integrated Intel GPU is the default one to be used system-wide, you tell your Nvidia GPU to run the specific application by running the command:

DRI_PRIME=1 specific-application 

. where specific-application is e.g. a 3D modelling application or a 3D game or any other program that requires a GPU with more powerful graphics processing capabilities. If e.g. you want your Nvidia GPU to process the graphics of the Inkscape application, just run:

In order to run Blender using your Nvidia GPU instead of the integrated Intel GPU, just run:

Suppose that you want Blender to always use your Nvidia GPU instead of the integrated Intel GPU. In such case, you may use a text editor (such as GEdit, Nano, Mousepad, Leafpad etc.) in order to edit Blender's .desktop file:

sudo gedit /usr/share/applications/blender.desktop 
Exec=DRI_PRIME=1 /usr/bin/blender %u 

. then just save the file, exit the text editor and start Blender by clicking on its icon at the Applications menu. Each one of those application icons at the Applications menu are one .desktop file, so if you modify e.g. blender.desktop you're pretty much modifying the Blender application shortcut at your Applications menu so when you click on such shortcut it runs Blender with DRI_PRIME set as 1 (i.e. use the Nvidia GPU to run Blender).

In case you don't know which is the current default GPU, run this command:

glxinfo | grep "OpenGL renderer" 

And in order to see which GPU is activated when you set DRI_PRIME=1 , run this command:

DRI_PRIME=1 glxinfo | grep "OpenGL renderer" 

If your integrated Intel GPU is already set as the default (system-wide) GPU, then the first command ( glxinfo | grep "OpenGL renderer" ) will inform you that Intel is the GPU ran by glxinfo by default, and the second command ( DRI_PRIME=1 glxinfo | grep "OpenGL renderer" ) will inform you that Nvidia is the GPU ran by DRI_PRIME=1 glxinfo (i.e. Nvidia is not the default / system-wide GPU, but DRI_PRIME=1 successfully set Nvidia as the active GPU for that specific process initiated by DRI_PRIME=1 glxinfo | grep "OpenGL renderer" ).

Источник

Оцените статью
Adblock
detector