How to launch individual Steam games w/ discrete graphics?

Hi I’m on Fedora 40 KDE plasma with steam installed via flatpak. It seems like my main graphics is going off my intel iGPU which is fine for most usage but I need to get steam games to be set to use the discrete graphics I have.

I installed “akmod-nvidia” but did not install “xorg-x11-drv-nvidia-cuda” as it was optional per Howto/NVIDIA - RPM Fusion
I also followed the Secure Boot instructions for importing the key Howto/Secure Boot - RPM Fusion
My display cables all connect to my GPU, but I can’t see my GPU stats in any of the resource/usage monitor apps. In general I’m not sure how to even use my discrete graphics (GPU) anywhere currently. I think I got it installed correctly but there isn’t a right click to run with discrete graphics on KDE plasma like there was on GNOME.

So how do I get my GPU to be used for specific steam games?

Below are a few commands ran and their results, hopefully this helps explain.

modinfo -F version nvidia
555.58.02
/sbin/lspci | grep -e VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3070 Lite Hash Rate] (rev a1)
lsmod |grep nouveau
nouveau              3923968  119
drm_ttm_helper         12288  2 xe,nouveau
gpu_sched              65536  2 xe,nouveau
drm_gpuvm              45056  2 xe,nouveau
drm_exec               12288  3 drm_gpuvm,xe,nouveau
i2c_algo_bit           20480  3 xe,i915,nouveau
ttm                   114688  4 drm_ttm_helper,xe,i915,nouveau
drm_display_helper    278528  3 xe,i915,nouveau
mxm_wmi                12288  1 nouveau
video                  81920  3 xe,i915,nouveau
wmi                    32768  4 video,wmi_bmof,mxm_wmi,nouveau
lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 Display controller: Intel Corporation AlderLake-S GT1 (rev 0c)
        DeviceName: Onboard - Video
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7d25
        Kernel driver in use: i915
--
01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3070 Lite Hash Rate] (rev a1)
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 3909
        Kernel driver in use: nouveau
        Kernel modules: nouveau, nvidia_drm, nvidia
inxi -Fzxx
System:
  Kernel: 6.10.10-200.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.41-37.fc40
  Desktop: KDE Plasma v: 6.1.5 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
    Distro: Fedora Linux 40 (KDE Plasma)
Machine:
  Type: Desktop Mobo: Micro-Star model: PRO Z690-A WIFI DDR4(MS-7D25) v: 1.0
    serial: <superuser required> UEFI: American Megatrends LLC. v: 1.J0
    date: 08/15/2024
CPU:
  Info: 10-core (6-mt/4-st) model: 12th Gen Intel Core i5-12600K bits: 64
    type: MST AMCP arch: Alder Lake rev: 2 cache: L1: 864 KiB L2: 9.5 MiB
    L3: 20 MiB
  Speed (MHz): avg: 2786 high: 4456 min/max: 800/4900:3600 cores: 1: 4318
    2: 2524 3: 800 4: 799 5: 894 6: 2914 7: 3832 8: 800 9: 4456 10: 4445
    11: 3620 12: 4230 13: 2927 14: 1284 15: 3400 16: 3346 bogomips: 117964
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel AlderLake-S GT1 vendor: Micro-Star MSI driver: i915
    v: kernel ports: active: none empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2,
    HDMI-A-3, HDMI-A-4 bus-ID: 00:02.0 chip-ID: 8086:4680
  Device-2: NVIDIA GA104 [GeForce RTX 3070 Lite Hash Rate]
    vendor: Micro-Star MSI driver: nouveau v: kernel arch: Ampere pcie:
    speed: 16 GT/s lanes: 16 ports: active: DP-3,HDMI-A-5 empty: DP-4,DP-5
    bus-ID: 01:00.0 chip-ID: 10de:2488
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 24.1.2
    compositor: kwin_wayland driver: N/A d-rect: 4480x2520 display-ID: 0
  Monitor-1: DP-3 pos: primary,top-left res: 2560x1440 size: N/A
  Monitor-2: HDMI-A-5 pos: bottom-r res: 1920x1080 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: iris device: 1 drv: nouveau
    device: 2 drv: swrast gbm: drv: iris surfaceless: drv: iris wayland:
    drv: nouveau x11: drv: nouveau
  API: OpenGL v: 4.6 compat-v: 4.3 vendor: mesa v: 24.1.7 glx-v: 1.4
    direct-render: yes renderer: NV174 device-ID: 10de:2488 display-ID: :0.0
  API: Vulkan v: 1.3.290 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: N/A device-ID: 10de:2488 device: 1
    type: integrated-gpu driver: N/A device-ID: 8086:4680 device: 2 type: cpu
    driver: N/A device-ID: 10005:0000
Audio:
  Device-1: Intel Alder Lake-S HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:7ad0
  Device-2: NVIDIA GA104 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:228b
  Device-3: Creative Pebble V3 driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 bus-ID: 1-1:10 chip-ID: 041e:3272
  API: ALSA v: k6.10.10-200.fc40.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.0.8 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 Alder Lake-S PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:7af0
  IF: wlo1 state: down mac: <filter>
  Device-2: Intel Ethernet I225-V vendor: Micro-Star MSI driver: igc
    v: kernel pcie: speed: 5 GT/s lanes: 1 port: N/A bus-ID: 04:00.0
    chip-ID: 8086:15f3
  IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 bus-ID: 1-14:5 chip-ID: 8087:0026
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: <filter> bt-v: 5.2 lmp-v: 11
Drives:
  Local Storage: total: 1.82 TiB used: 62.93 GiB (3.4%)
  ID-1: /dev/nvme0n1 model: PCIe SSD size: 1.82 TiB speed: 63.2 Gb/s
    lanes: 4 serial: <filter> temp: 44.9 C
Partition:
  ID-1: / size: 1.82 TiB used: 62.55 GiB (3.4%) fs: btrfs dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 377.2 MiB (38.8%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 19 MiB (3.2%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 1.82 TiB used: 62.55 GiB (3.4%) fs: btrfs
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 1.5 MiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 39.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 32 GiB note: est. available: 31.12 GiB used: 8.79 GiB (28.2%)
  Processes: 450 Power: uptime: 3h 59m wakeups: 0 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: flatpak pkgs: 25 Compilers: gcc: 14.2.1 Shell: Bash
    v: 5.2.26 running-in: konsole inxi: 3.3.34
lsmod | grep nvidia
glxinfo | grep 'OpenGL renderer'
OpenGL renderer string: NV174
DRI_PRIME=pci-0000_06_00_0 glxinfo | grep 'OpenGL renderer'
OpenGL renderer string: NV174

Thanks!

1 Like

Added gaming, steam, wayland

Try adding this as a launch option in Steam:

__VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia %command%
1 Like

If you are on Gnome, You can use switcherooctl to launch the application/game. Also, in the Steam properties you could use DRI_PRIME=1

How do I set the steam properties? I use KDE Plasma, no GNOME.

Right-click games in Steam → Properties → Launch Options

Any environment variables used also need to be behind %command%. With DRI_PRIME:

DRI_PRIME=1 %command%

Back when I did Optimus I did the VK_LAYER/GLX_VENDOR stuff and used NVIDIA’s PRIME method. Afaik there’s that, DRI_PRIME (never tried it with switcherooctl), having one GPU or the other handle everything (easiest), and other stuff (Bumblebee, etc)

1 Like

Based on my outputs in my original post, is my nvidia graphics card DRI_PRIME 1 or is it 2?

I kinda wanna keep intel iGPU as my main graphics but only use my nvidia card for games.

Assuming that I can get the discrete graphics to work for games, what app can I use to know for sure that the GPU is running game and not iGPU? I play mostly Counter Strike 2 on steam and it’s native to linux.

In a Terminal try this, and switch 0 to 1:

DRI_PRIME=0 glxinfo | grep renderer

0 is likely Mesa Intel(R) something, and 1 should be something NVIDIA.

If that works, then anything with DRI_PRIME=1 specified will use the NVIDIA GPU, and anything not specified will default to Intel.

1 Like

Both of 0 and 1 result in:

OpenGL renderer string: NVIDIA GeForce RTX 3070/PCIe/SSE2

I updated my launch option in hitman WoA game, I do see my nvidia card as graphics option 1 default. Thanks for the help, I think I will have to try a few more games out and get comfortable with this process.

Slightly offtopic, can you recommend a good system monitor app with graphics card support? The default one on Fedora KDE Plasma doesn’t have that available to me I think

1 Like

Not quite, but I use intel_gpu_top from Terminal, and used something I’m pretty sure something similar through nvidia-smi. NVIDIA’s control panel also has a utilization percent iirc.

In games as an overlay, I usually use DXVK_HUD=full or something with GALLIUM_HUD=, and MangoHud seems pretty popular (haven’t tried that yet)

That sounds like the NV GPU is being used everywhere, but did you happen to check how the GPUs are used from Windows?

I have an Alienware laptop with RTX 3060, and even though it shows the Intel UHD integrated GPU, NVIDIA is used everywhere (laptop screen/ports are wired to NVIDIA), there’s no BIOS option to switch the graphics, and if I read right it’s intentional (seems odd but it’s a gaming laptop and maybe Alienware didn’t want a chance to be bothered about Intel GPU performance :stuck_out_tongue:)

But in that case, there’s no way to avoid using the NVIDIA GPU, but I imagine forcing things to use the Intel GPU to do PRIME the other way around could work (that’s likely what DRI_PRIME=1 would do with the NVIDIA GPU being primary/0), but that also needs additional set-up it looks like.

Do either of these present Intel?

__NV_PRIME_RENDER_OFFLOAD=0 __GLX_VENDOR_LIBRARY_NAME=intel glxinfo | grep renderer
__NV_PRIME_RENDER_OFFLOAD=0 glxinfo | grep renderer
1 Like

Nope

__NV_PRIME_RENDER_OFFLOAD=0 __GLX_VENDOR_LIBRARY_NAME=intel glxinfo | grep renderer
OpenGL renderer string: NVIDIA GeForce RTX 3070/PCIe/SSE2
__NV_PRIME_RENDER_OFFLOAD=0 glxinfo | grep renderer
OpenGL renderer string: NVIDIA GeForce RTX 3070/PCIe/SSE2

Thanks for all the assistance. I guess all nvidia is fine with me as well, Optimus and Prime seems like too many steps for my casual use. Will mark one of your replies as solution, cheers

1 Like

I discovered GNOME Resources and they mention there’s GPU monitoring: Resources – Apps for GNOME