On a laptop with a non-optimus dedicated Nvidia GPU, how can I force an application to use it instead of the CPU?

I have a new laptop with an Nvidia RTX 2060 and an intel i7-9750H, running Fedora 31 KDE spin. I have always used fedora without issue though never before with a dedicated GPU. I've installed the proprietary nvidia drivers from rpmfusion and it appears to be recognized, though the CPU appears to be handling all of the graphical work and I'm not sure what to do about it. As far as I know this is not an Optimus graphics card so I can't use bumblebee/optirun to switch from cpu to gpu graphics (if there's a way to selectively use the card like that though I'm all ears, that'd be the ideal solution).

All the relevant information I could think of (or be told is relevant by Google) is below. I'm not sure what to do from here. I'll provide whatever relevant followup information is requested.

Relevant lspci output:

[root@bulbasaur ~]# lspci -v|grep VGA
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] (rev a1) (prog-if 00 [VGA controller])

glxinfo output:

[root@bulbasaur ~]# glxinfo |grep render
direct rendering: Yes GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2) GL_ARB_compute_shader, GL_ARB_conditional_render_inverted, GL_NV_conditional_render, GL_NV_depth_clamp, GL_ARB_compute_shader, GL_ARB_conditional_render_inverted, GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance, GL_EXT_read_format_bgra, GL_EXT_render_snorm, GL_EXT_robustness, GL_NV_conditional_render, GL_NV_draw_buffers, GL_NV_fbo_color_attachments, GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,

Screenshot of nvidia-settings, showing no XWindows items in the left:

glmark2 output:

 glmark2 2017.07 OpenGL Information GL_VENDOR: Intel Open Source Technology Center GL_RENDERER: Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2) GL_VERSION: 3.0 Mesa 19.2.4

One of the solutions I found on Google was to copy nvidia.conf into /etc, which I did as follows:

# cp /usr/share/X11/xorg.conf.d/nvidia.conf /etc/X11/xorg.conf.d/

and to add the line Option "PrimaryGPU" "yes" which I did, to no effect:

 [root@bulbasaur xorg.conf.d]# cat nvidia.conf #This file is provided by xorg-x11-drv-nvidia #Do not edit Section "OutputClass" Identifier "nvidia" MatchDriver "nvidia-drm" Driver "nvidia" Option "AllowEmptyInitialConfiguration" Option "SLI" "Auto" Option "BaseMosaic" "on" EndSection Section "ServerLayout" Option "PrimaryGPU" "yes" Identifier "layout" Option "AllowNVIDIAGPUScreens" EndSection
3

1 Answer

Switch between the graphic cards and/or reinstall the NVIDIA drivers.

Your laptop is using the integrated GPU [intel] instead of the NVIDIA one.
You can read in different points of the output you posted (UHD Graphics 630).

The following command should give you an output more readable.

glxinfo|egrep "OpenGL vendor|OpenGL renderer"

Try with

sudo prime-select nvidia

If you do not have prime-select on your system I suppose you should reinstall the NVIDIA driver, reboot the system, select nvidia and reboot again. Rebooting each time may be an overkill, it should be enough to restart the graphics part (sudo service lightdm restart or similar).

Then on your nvidia-settings it should be present another voice PRIME Profiles on the left panel that allows you to switch between the two graphic cards.

nvidia-settings-PRIME

You can read more on how to reinstall the NVIDIA drivers and How To Switch Between Intel and Nvidia Graphics Card (even if for Ubuntu) on many pages on the net.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like