Use nvidia gpu on desktop PC with intel

Hello Fedora community!

I use Fedora Workstation 39 on a desktop PC with an Intel Core i3 8100 processor (with Intel UHD Graphics 630) and a dedicated GTX 1050 Ti graphics card.
2 monitors are connected to the system:

  1. 4k
  2. 1080p

The Gnome working environment runs on Wayland, the proprietary Nvidia driver is installed.
But on a monitor with a high resolution, the system’s operation seems to have a jelly effect (simply selecting text in a text editor loads the processor up to 90% and the sampling frequency seems to be 30 hertz instead of 60).And if you launch an application using discrete graphics using the right mouse button, the situation does not improve. I spent about 4 months reading materials on this topic, but never found a solution.

According to my feelings, the whole point is that the Gnome-shell loads on Intel graphics and only uses 1 MB of Nvidia GPU…

use

nvidia-smi

confirms this

lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630]
01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)

The problem can be partially solved if in the UEFI BIOS you disable the detection of the graphics core of the processor and set PEG, auto, PSI instead

In this case, the system will also launch on the wayland without any problems, but output to monitors will be possible only when they are connected to the video card connectors. But some programs stop running (which I almost don’t have anyway). Also, on Fedora 38, artifacts and image breaks appeared during rendering; on version 39 this problem went away. But on the other hand, the rendering itself on a monitor with a higher resolution becomes much nicer and sharper, as if 2 times faster, better positioning of the mouse cursor, text selection, scrolling and everything connected with it. CPU usage during rendering also goes away.

In this case, the Intel Graphics 630 graphics processor is not detected at all, although at the system boot stage the logo on the monitor connected to the motherboard lights up for a few seconds, but then it goes out until you switch it to the Nvidia card slot.

Each of these solutions is inherently defective. I would like to figure out how this should actually work, I read about prime and reverse prime, but I couldn’t implement it on my own, I have a feeling that in this case reverse prime can help if the gnome shell is forced to run on the Nvidia graphics, without disabling the processor graphics in the UEFI BIOS.

My goal is to achieve comfortable work with the system… So I would be grateful for any help, my dear friends!!!

inxi -Fzxx when the Intel UHD graphics core is enabled in the UEFI BIOS

inxi -Fzxx
System:
Kernel: 6.6.11-200.fc39.x86_64 arch: x86_64 bits: 64 compiler: gcc
v: 2.40-13.fc39 Desktop: GNOME v: 45.3 tk: GTK v: 3.24.39 wm: gnome-shell
dm: GDM Distro: Fedora release 39 (Thirty Nine)
Machine:
Type: Desktop Mobo: ASUSTeK model: PRIME B360M-A v: Rev X.0x
serial: UEFI: American Megatrends v: 2416
date: 05/27/2019
CPU:
Info: quad core model: Intel Core i3-8100 bits: 64 type: MCP
arch: Coffee Lake rev: B cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 2200 high: 3600 min/max: 800/3600 cores: 1: 3600 2: 800
3: 3600 4: 800 bogomips: 28800
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] vendor: ASUSTeK
driver: i915 v: kernel arch: Gen-9.5 ports: active: HDMI-A-1
empty: DP-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:3e91
Device-2: NVIDIA GP107 [GeForce GTX 1050 Ti] vendor: Micro-Star MSI
driver: nvidia v: 545.29.06 arch: Pascal pcie: speed: 2.5 GT/s lanes: 16
ports: active: none off: DP-2 empty: DVI-D-1,HDMI-A-3 bus-ID: 01:00.0
chip-ID: 10de:1c82
Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 23.2.3
compositor: gnome-shell driver: X: loaded: modesetting,nvidia
unloaded: fbdev,vesa alternate: nouveau,nv dri: iris
gpu: i915,nvidia,nvidia-nvswitch display-ID: 0
Monitor-1: DP-2 model: LG (GoldStar) HDR 4K res: 3840x2160 dpi: 163
diag: 690mm (27.2")
Monitor-2: HDMI-A-1 model: HP 27f res: 1920x1080 dpi: 82 diag: 686mm (27")
API: OpenGL v: 4.6 vendor: intel mesa v: 23.3.3 glx-v: 1.4 es-v: 3.2
direct-render: yes renderer: Mesa Intel UHD Graphics 630 (CFL GT2)
device-ID: 8086:3e91 display-ID: :0.0
API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
Device-1: Intel Cannon Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel
v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a348
Device-2: NVIDIA GP107GL High Definition Audio vendor: Micro-Star MSI
driver: snd_hda_intel v: kernel pcie: speed: 2.5 GT/s lanes: 16
bus-ID: 01:00.1 chip-ID: 10de:0fb9
API: ALSA v: k6.6.11-200.fc39.x86_64 status: kernel-api
Server-1: PipeWire v: 1.0.1 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin
Network:
Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel pcie:
speed: 2.5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8086:095a
IF: wlp4s0 state: up mac:
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: ASUSTeK PRIME B450M-A driver: r8169 v: kernel pcie: speed: 2.5 GT/s
lanes: 1 port: 3000 bus-ID: 05:00.0 chip-ID: 10ec:8168
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac:
Bluetooth:
Device-1: Intel Bluetooth wireless interface driver: btusb v: 0.8 type: USB
rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 1-14:5 chip-ID: 8087:0a2a
Report: btmgmt ID: hci0 rfk-id: 2 state: up address: bt-v: 4.2
lmp-v: 8
Drives:
Local Storage: total: 1.25 TiB used: 36.16 GiB (2.8%)
ID-1: /dev/nvme0n1 model: 256GB MEGA S3 256GB size: 238.47 GiB
speed: 31.6 Gb/s lanes: 4 serial: temp: 35.9 C
ID-2: /dev/sda vendor: Kingston model: HyperX Fury 3D 120GB
size: 111.79 GiB speed: 6.0 Gb/s serial:
ID-3: /dev/sdb vendor: Toshiba model: HDWD110 size: 931.51 GiB
speed: 6.0 Gb/s serial:
Partition:
ID-1: / size: 236.89 GiB used: 35.74 GiB (15.1%) fs: btrfs
dev: /dev/nvme0n1p3
ID-2: /boot size: 973.4 MiB used: 419.9 MiB (43.1%) fs: ext4
dev: /dev/nvme0n1p2
ID-3: /boot/efi size: 598.8 MiB used: 17.4 MiB (2.9%) fs: vfat
dev: /dev/nvme0n1p1
ID-4: /home size: 236.89 GiB used: 35.74 GiB (15.1%) fs: btrfs
dev: /dev/nvme0n1p3
Swap:
ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 38.0 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Processes: 320 Uptime: 3h 3m Memory: total: 32 GiB available: 31.19 GiB
used: 7.37 GiB (23.6%) Init: systemd v: 254 target: graphical (5)
default: graphical Compilers: gcc: 13.2.1 Packages: pm: rpm pkgs: N/A
note: see --rpm pm: flatpak pkgs: 21 Shell: Bash v: 5.2.21
running-in: gnome-terminal inxi: 3.3.31

In your case the fix may be simple if you wish to try it (although it only works when use the xorg desktop)

That sets the system to only use the nvidia gpu so the monitors would need to be attached to that card. This particular method also does not work at all with wayland.

Thank you very much!
I read the article you suggested and thought about it…
I tried to reboot into X-org, having previously set the main display to automatic in the UEFI BIOS. Surprisingly, without reconnecting monitor ports, everything works 4k - connected to the Nvidia video card, and 1080p to the motherboard’s HDMI connector, and my several work programs run without problems.

The advantage of X-org over Wayland in this situation was that there was no need to connect both monitors to the Nvidia video card, and programs were launched that did not run on Wayland. The Nvidia X-Server utility has added additional settings that did not exist before.

But now the problem of upscaling has appeared (on a 4k monitor the crop is 200% and without my participation it was distributed to a 1080p monitor), what to do in this situation? And is it possible to check whether the Intel graphics driver is enabled?

There was no such problem on Wayland; I never worked on X-Org :frowning:

I’m also worried that the Fedora project is positioning wayland as the main environment for gnome, is it worth working for x-org?

inxi -Fzxx

produces the following result

inxi -Fzxx
System:
Kernel: 6.6.11-200.fc39.x86_64 arch: x86_64 bits: 64 compiler: gcc
v: 2.40-13.fc39 Desktop: GNOME v: 45.3 tk: GTK v: 3.24.39 wm: gnome-shell
dm: GDM Distro: Fedora release 39 (Thirty Nine)
Machine:
Type: Desktop Mobo: ASUSTeK model: PRIME B360M-A v: Rev X.0x
serial: UEFI: American Megatrends v: 2416
date: 05/27/2019
CPU:
Info: quad core model: Intel Core i3-8100 bits: 64 type: MCP
arch: Coffee Lake rev: B cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 3600 high: 3602 min/max: 800/3600 cores: 1: 3600 2: 3602
3: 3601 4: 3600 bogomips: 28800
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] vendor: ASUSTeK
driver: i915 v: kernel arch: Gen-9.5 ports: active: HDMI-A-1
empty: DP-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:3e91
Device-2: NVIDIA GP107 [GeForce GTX 1050 Ti] vendor: Micro-Star MSI
driver: nvidia v: 545.29.06 arch: Pascal pcie: speed: 8 GT/s lanes: 16
ports: active: none off: DP-2 empty: DVI-D-1,HDMI-A-3 bus-ID: 01:00.0
chip-ID: 10de:1c82
Display: x11 server: X.Org v: 1.20.14 with: Xwayland v: 23.2.3
compositor: gnome-shell driver: X: loaded: modesetting,nvidia
unloaded: fbdev,vesa alternate: nouveau,nv dri: iris
gpu: i915,nvidia,nvidia-nvswitch display-ID: :0 screens: 1
Screen-1: 0 s-res: 5760x2160 s-dpi: 96
Monitor-1: DP-2 mapped: DP-0 note: disabled pos: primary,top-left
model: LG (GoldStar) HDR 4K res: 3840x2160 dpi: 163 diag: 690mm (27.2")
Monitor-2: HDMI-A-1 mapped: HDMI-1-1 pos: bottom-r model: HP 27f
res: 1920x1080 dpi: 82 diag: 686mm (27")
API: OpenGL v: 4.6.0 vendor: nvidia v: 545.29.06 glx-v: 1.4
direct-render: yes renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
API: EGL Message: EGL data requires eglinfo. Check --recommends.

nvidia-smi

lspci | grep VGA

01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)

And I don’t understand why the image was displayed so smoothly via X-org on the second monitor (which is connected to the motherboard, and not the Nvidia video card), but this function does not work on Wayland…

Eventually xorg will disappear but that still appears to be far into the future. If xorg does what you need then just use it without worries of what may happen years from now.

If you have different issues I suggest you open a thread specifically about this.

Wayland and xorg are different and what is behind the scenes I cannot assist with.

Thank you for trying to help!

Using the trial method, I decided to try working on Wayland, with monitors connected to an Nvidia video card, due to the smoothest operation and the possibility of different percentages of image cropping on the monitors. But not in all programs.

For those who will encounter similar problems in the future, I would like to separately note that on Wayland using only the proprietary Nvidia driver, when using some programs, unexpected processor loads are observed, up to 90%, even during periods when no energy-intensive processes are in use . The same image tearing is observed when resizing the window of any non-system applications, and at the same time graphics drawdowns (for example, text lag during printing, some kind of incomprehensible twitching), when the system is turned off or falls asleep, terrible artifacts appear on the main monitor… (case not in hardware, of course, on some Windows 10 all this is missing, hybrid graphics and everything else work)

Therefore, it seems that fedora 39 workstation on Gnome 45.3 running Wayland is simply unsuitable for adequate use when working with Nvidia video cards on desktop computers. Yes, Intel graphics work well, but they cannot cope with the tasks I set, although the task is essentially the same - to display a normal image on 2 monitors, one of which is connected directly to the video card (and it shouldn’t, there is a dedicated Nvidia video card for this). Although, this compatibility is indicated in all the documentation that I was able to find for Gnome, Nvidia, Fedora.

Most likely, I will try to use Fedora on the X-11 version for some time, since there are fewer problems with phantom processor overloads (instead of 90% it loads at 45%, which is unpleasant, but acceptable) and, most importantly, text lag when printing /scrolling is observed less frequently, and there is also no bug of random flickering of part of the image (for example, when closing the application, the process end icon on Wayland begins to flicker for reasons unknown to me). Unfortunately, the image tearing when resizing the application window remains, but it is less noticeable, I would rather describe it as a jelly effect, but now it affects the entire image, and not just the application on which we are resizing. One of the main disadvantages in this scenario is that, due to the impossibility of adequately setting up monitors with different dpi (ppi) numbers, the second monitor turns into a pumpkin and is practically useless.

The only solution to my specific situation seems to me to be the selection of a different Linux distribution. :frowning:

In any case, I want to try to work more on each of the scenarios I described in order to draw clear conclusions; along the way, I will further delve into the documentation for solving the problem (although it is absolutely not obvious to me, because on desktop computers the possibilities for variation are much wider than on laptops ).

If you have any other ideas and suggestions for solving this problem, I would be happy to listen to them! After all, Fedora is a good distribution with a great community!!!

I am sure that I am not alone in my search and together we will get to the truth! :slight_smile: