mmtrt / leagueoflegends

Unofficial league of legends snap repo
https://snapcraft.io/leagueoflegends
GNU Lesser General Public License v2.1
220 stars 27 forks source link

Nvidia graphics not used #121

Closed bes1002t closed 4 years ago

bes1002t commented 4 years ago

When playing the game the cli tool nvidia-smi returns the following information which leads to the assumption that my nvidia graphics card is not used:

Mon Apr 20 01:09:19 2020
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce RTX 2060 Off | 00000000:01:00.0 Off | N/A | | N/A 54C P8 3W / N/A | 31MiB / 5934MiB | 0% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1617 G /usr/libexec/Xorg 14MiB | | 0 2197 G /usr/libexec/Xorg 14MiB | +-----------------------------------------------------------------------------+

Laptop: MSI GL63 8SE OS: Fedora 31

Nvidia drivers are installed via rpmfusion and it should work, because as you can see Xorg is already using the nvidia graphics card.

mmtrt commented 4 years ago

I think you have to use nvidia prime or anyother method to use dedicated gpu though you have use it with leagueoflegends command.

see about it here https://wiki.archlinux.org/index.php/Hybrid_graphics

bes1002t commented 4 years ago

@mmtrt as far as I know the optimus technology is already implemented in nvidia driver for RTX2060. So this should work in my humble opinion.

mmtrt commented 4 years ago

I think that doesn't work with snaps so users have to use it manually.

bes1002t commented 4 years ago

I noticed this post: https://forum.snapcraft.io/t/general-question-about-nvidia-on-demand-and-snaps/15931

when using the shell script

!/bin/bash

NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME="nvidia" VK_LAYER_NV_optimus=NVIDIA_only TERM=xterm $@

and call in terminal 'script leagueoflegends', nvidia-smi shows that the rtx2060 is used. +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce RTX 2060 Off | 00000000:01:00.0 Off | N/A | | N/A 47C P8 4W / N/A | 208MiB / 5934MiB | 8% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1635 G /usr/libexec/Xorg 14MiB | | 0 2185 G /usr/libexec/Xorg 45MiB | | 0 9408 G ...e of Legends/Game/League of Legends.exe 145MiB | +-----------------------------------------------------------------------------+

I don't know whether it is possible to include this in the snap, but would be cool.

mmtrt commented 4 years ago

you can create desktop file launching that script file for convenience.

bes1002t commented 4 years ago

@mmtrt yes this solution works for me, but everyone else has to search for this issue to find my solution. It would be easier for each consumer of this snap if this is integrated to the snap somehow.

mmtrt commented 4 years ago

can you upgrade snap and test changes see if it uses NV gpu with this command or also test desktop file in menu for nv optimus.

leagueoflegendsnv

bes1002t commented 4 years ago

I've updated my snap but there is no command 'leagueoflegendsnv'. I tried using the default command without my script and it is not using the nvidia graphics card.

Maybe I did something wrong while updating the snap? I explicitly updated the leagueoflegends snap using the dev mode arg, to make sure this snap is up to date.

mmtrt commented 4 years ago

oops my bad actual command is this,

leagueoflegends.leagueoflegendsnv

bes1002t commented 4 years ago

yes it works quite well :) thanks for integrating this!