Score:0

how to set nvidia gpu card as primary card

za flag

I have installed steam on Ubuntu 20.04.5 and I'd like to use only the dedicated GPU in games, not the UHD Graphics 620. The games that I try, such as Tropico 6, keep the Intel UHD GPU as main.

I see the NVIDIA GPU on the info of the OS, but there are some problems running some commands (like nvidia-settings or nvidia-xconfig).

$ lshw -short | grep -i display WARNING: you should run this program as super-user. WARNING: output may be incomplete or inaccurate, you should run this program as super-user. /0/100/2 
display UHD Graphics 620 (Whiskey Lake) /0/100/1c.4/0 
display GP108M [GeForce MX150]
$ lspci -nn | grep -E 'VGA|Display' 00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 620 (Whiskey Lake) [8086:3ea0]

This command does nothing:

$ sudo nvidia-xconfig
WARNING: Unable to locate/open X configuration file.

Package xorg-server was not found in the pkg-config search path. Perhaps you should add the directory containing `xorg-server.pc' to the PKG_CONFIG_PATH environment variable No package 'xorg-server' found New X configuration file written to '/etc/X11/xorg.conf'

Using sudo nvidia-settings I get the error bellow:

(nvidia-settings:4655): GLib-GObject-CRITICAL **: 11:28:24.506: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

ERROR: nvidia-settings could not find the registry key file or the X server is not accessible. This file should have been installed along with this driver at /usr/share/nvidia/nvidia-application-profiles-key-documentation. The application profiles will continue to work, but values cannot be prepopulated or validated, and will not be listed in the help text. Please see the README for possible values and descriptions.

Here are screenshots of the OS info and the driver I use:

OS info

Additional drivers

What can I do?

David avatar
cn flag
You most likely based on the errors are running Wayland not xorg. Logout and on the login screen there is the cog wheel choose that and choose xorg and then login and try the commands again.
babuz87 avatar
za flag
can you repeat? i didn't geit
David avatar
cn flag
No other way to explain it.
babuz87 avatar
za flag
any screenshot where can i do this?
babuz87 avatar
za flag
I logoff from the ubuntu session , but if I logon in xorg my password doesn't work, do you know why?
David avatar
cn flag
No idea the password is for the OS not for the desktop environment.
babuz87 avatar
za flag
something is change now on OS info i see NVIDIA Corporation GP108M [GeForce MX150] / Mesa Intel® UHD Graphics 620 (WHL GT2) . But this game Tropico 6 don't use the main Gpu, i don't know why
Score:0
cc flag

Laptops which have two GPUs (e.g. Intel and Nvidia) usually use a hybrid setup, so the Nvidia GPU does the display setup, and the Intel GPU outputs the display. Lately, Ubuntu releases seem to have confused which GPU does what. The "default" GPU gets changed depending upon settings, and suddenly, games can't run anymore on the Intel GPU. You may see the GPU association by:

xrandr --listproviders

The default (0 GPU?) changes when you change a power option from Performance (which selects the Nvidia GPU as default) to Balanced (which selects the Intel as default). Simply select "performance" for the power option.

For running a program without changing power options, you may prepend the program with:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <progtorun>

This will switch the assignment of GPU so they are used the way they should be.

babuz87 avatar
za flag
set it on environment variable. It works bette with some games. But tropico 6 in the graphics settings main menu display me that it use Intel card. I don't know why
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.