You are not logged in.

#1 2025-02-26 19:25:57

igormiti
Member
Registered: 2025-02-26
Posts: 2

xorg is using my nvidia gpu, even though i made sure it doesnt use it

hello, im using a lenovo ideapad gaming laptop, that has an integrated gpu and a nvidia gpu. my laptop dies very fast (from 80 to 70 in something like 10/20 minutes), something that didnt happen on windows 11 (im dual booting arch and windows 11, and arch is on an external ssd connected via usb, so when i dont need arch i just unplug the ssd and use windows). now, i use kde plasma and i went in the x11 conf files and i wrote this:
$ cat /etc/X11/xorg.conf.d/10-nvidia.conf
Section "Device"
    Identifier  "NVIDIA Card"
    Driver      "nvidia"
    BusID       "PCI:1:0:0"
    Option      "PrimaryGPU" "no"
    Option      "AllowEmptyInitialConfiguration"
    Option      "IgnoreDisplayDevices" "CRT, DFP, TV"
EndSection

nvidia-smi output:
Wed Feb 26 20:22:05 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.86.16              Driver Version: 570.86.16      CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3060 ...    Off |   00000000:01:00.0 Off |                  N/A |
| N/A   47C    P0             23W /   80W |       1MiB /   6144MiB |      2%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

sudo lsof /dev/nvidia*                       
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
COMMAND PID USER FD   TYPE  DEVICE SIZE/OFF NODE NAME
Xorg    760 root 17u   CHR 195,255      0t0 1114 /dev/nvidiactl

my two GPUs:
lspci | grep -E "VGA|3D" 
0000:00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P GT1 [UHD Graphics] (rev 0c)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)

(i had these lines in the bootloader: nvidia_drm.fbdev=1 nvidia_drm.modeset=1, and my gpu is still being used)

any help is appreciated!!

Offline

#2 2025-02-26 19:48:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: xorg is using my nvidia gpu, even though i made sure it doesnt use it

The correct way to tell xorg to ignore a device entirely is to instead configure a device for the iGPU you want to be used, which will disable auto detection and only run on the specified device. 

Section "Device"
    Identifier  "intel GPU"
    Driver      "modesetting"
    BusID       "PCI:0:2:0"
EndSection

I highly doubt this will help with your underlying issues, since that modern nvidia gpu will go into a power saving mode if nothing is actively using it, and the 4MB xorg process you get by default counts as "nothing". FWIW there have been some issues with nvidia-open in that case, in which case you might want to rather test nvidia, potentially together with the  "nvidia.NVreg_EnableGpuFirmware=0" kernel option .

I find it much more likely that having to drive an entire external SSD for the main operating system to be a much heavier factor in your powerdraw. Also check the overall draw reported by tools like powertop. And nvidia-smi will wake the device to query stats if you want to check whether runtime pm is enabled you'd rather check

cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status

see https://wiki.archlinux.org/title/PRIME#NVIDIA as well.

Last edited by V1del (2025-02-26 19:56:00)

Offline

#3 2025-02-27 09:48:40

igormiti
Member
Registered: 2025-02-26
Posts: 2

Re: xorg is using my nvidia gpu, even though i made sure it doesnt use it

first of all, thanks for replying. i actually have an entry for my intel gpu so it uses it as primary gpu.
i didnt know that nvidia-smi still woke the gpu

``` cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status
werdly enough, before it said it was suspended, but now it says "active". isnt there a way i just "turn off" the nvidia gpu and use only the intel one, and then i use prime-run to "turn on" it (only when i need it, like on steam and things like that)

Offline

#4 2025-02-27 12:00:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: xorg is using my nvidia gpu, even though i made sure it doesnt use it

That which you envision is already the logical default without any config at all. As for the runtime status difference see the additional caveats from the section I linked, for Ampere GPUs there's an additional device node under sys whith a counter which increments when you query it while the GPU is "off".

Generally make sure you don't have xf86-video-intel installed as that would force you to software CPU rendering. And instead of just looking at the nvidia card look at overall draw with e.g. powertop. maybe also post the output you get from a powertop run.

Offline

Board footer

Powered by FluxBB