Score:0

Ubuntu will not use my GPU

mw flag

Guys I Have been researching for days on how to get this working. I have just started back with a fresh install to fix any nonsense that may have been messed up in the mean time, Now as far as i'm aware, DRI_PRIME=1 is 'supposed' to make the DGPU the primary if you use that line of code before running a program.
lspci -k | grep -EA2 'VGA|3D' shows

00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
DeviceName:  Onboard IGD
Subsystem: Dell Latitude E7470
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] (rev e5)
Subsystem: Dell Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X]
Kernel driver in use: amdgpu

so the system "sees" my gpu , just wont use it .

: $DRI_PRIME=1 glxinfo | grep "OpenGL renderer"

OpenGL renderer string: Mesa Intel(R) HD Graphics 520 (SKL GT2)

im on Kernel Linux 6.2.0-20-generic Ubuntu 23.04 Wayland

Guys i downgraded to LTS and immediately ran DRI_PRIME=1 before running any updates and it recognizes the card ..... I am horribly unsure why some OS's will do this and others wont as i have tried many distros . but i will not complain .

pl flag
Does this answer your question? [Launching Steam game on KDE on different GPU](https://askubuntu.com/questions/1391295/launching-steam-game-on-kde-on-different-gpu)
pl flag
I linked to a question I asked a year ago. It has some tips which may help. At the time I had a system with two GPUs like you, a NUC. I had to use some commands to interrogate the GPUs, which you'll find in the question and answer, and may help.
pl flag
(don't use Wayland would be my first step)
Michael Drop avatar
mw flag
im switching to LTS real quick , will continue trying there
Rishon JR avatar
pl flag
What is the output of `cat /etc/default/grub`? Sometimes it could be in nomodeset and could be preventing you from booting.
oldfred avatar
cn flag
UEFI should have a seting on which graphics is default. Make sure that is correct.
Score:0
cc flag

Used to be setting the power option to "performance" would set the DGPU as primary, but one day, my CUDA samples stopped working, because the demos were trying to run on the Intel GPU. A laptop is typically in hybrid mode, the DGPU does the hard work, and hands off to the Intel GPU for the display. See the output of xrandr when running X (the modeseting is the Intel):

 $ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x45 cap: 0x9, Source Output, Sink Offload crtcs: 4 outputs: 3 associated providers: 1 name:modesetting
Provider 1: id: 0x26e cap: 0x2, Sink Output crtcs: 4 outputs: 6 associated providers: 1 name:NVIDIA-G0

or maybe it looks like:

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b7 cap: 0x1, Source Output crtcs: 4 outputs: 6 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x1e7 cap: 0x6, Sink Output, Source Offload crtcs: 4 outputs: 3 associated providers: 1 name:modesetting

The first seems the source and sink are reversed, and need the __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia environment variables which may be used in front of a program you want to force to use the nvidia.

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <prog>
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.