You are not logged in.

#1 2025-04-02 08:28:33

gucio321
Member
Registered: 2024-10-17
Posts: 37

Temporarily disable NVIDIA Gpu (laptop)

Hi,
I've installed an oficial nvidia driver. Now I'm wondering if I can temporarily unload it (for energy economy).

I've tried like that, but it says that nvidia_drm is still in use

systemctl stop gdm
systemctl stop nvidia-persistenced
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
systemctl start gdm

Offline

#2 2025-04-02 10:23:47

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

Update: I managed to unload nvidia_drm (after retrying steps above), but now my laptop doesn't detect intel graphics so there is no gpu after unloading nvidia driver.

- lspci  shows only my nvidia (but I'm sure there is Intel UHD Graphics)
- the i915 kernel module exists, but is not loaded by default

what should I check now?

Offline

#3 2025-04-02 13:42:40

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

an oficial nvidia driver. Now I'm wondering if I can temporarily unload it (for energy economy)

What is "an oficial nvidia driver"? Which package did you install?
Do not use nvidia-installer.run-or-whatever script.

Why do you think unloading the kernel module would provide any battery benefits?
The device needs to be powered down, preferably RTD§ (if your GPU is elegible for that) and otherwise be cut off power w/ eg. bbswitch or acpid - merely unloading the driver can leave the HW in maximum power state and the bus active.

Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Offline

#4 2025-04-03 08:30:40

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

tyank you for your answer!
First of all, let me give an update: I managed to detect my iGPU by enabling it in bios. Now I have another problem - I can't disable nvidia/set intel as primary in wayland on gnome.

Let me answer your questions now:

What is "an oficial nvidia driver"? Which package did you install?
Do not use nvidia-installer.run-or-whatever script.

I use nvidia-open

Why do you think unloading the kernel module would provide any battery benefits?
The device needs to be powered down, preferably RTD§ (if your GPU is elegible for that) and otherwise be cut off power w/ eg. bbswitch or acpid - merely unloading the driver can leave the HW in maximum power state and the bus active.

tbh... idk. WHile searching the web I found solutions like that for disabling gpu but tbh it didn't say about battery benefits tbh. Anyway, unloading driver would be the first step before shutting down the gpu I think

Offline

#5 2025-04-03 08:35:58

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

btw:
GPU 1: NVIDIA GeForce RTX 2080 SUPER Mobile / Max-Q [Discrete]
GPU 2: Intel UHD Graphics @ 1.15 GHz [Integrated]

Offline

#6 2025-04-03 09:09:19

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

I've created the following script:

#!/bin/bash
echo -n "Loading bbswitch..."
modprobe bbswitch
echo "done"

echo -n "Stopping gdm..."
systemctl stop gdm
echo "done"

#systemctl stop nvidia-persistenced
echo -n "unloading nvidia..."
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia i2c_nvidia_gpu
echo "done"

echo -n "Disabling nvidia..."
tee /proc/acpi/bbswitch <<<OFF
lsmod |grep nvidia
echo "done"
#systemctl start gdm
### I cut error handling for clearity

It doesn't work in sense that it freezes on the last step (power off nvidia) (freezes = script ends and after ~1 second console stops responding - I suppose it isn't only display issue because I can't `reboot`)

Offline

#7 2025-04-03 15:16:05

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

and also the output of

nvidia-smi

and

glxinfo -B

On a formal note, please don't bump - edit your previous post to mend it if nobody has yet replied.

Offline

#8 2025-04-03 15:41:36

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

journal: https://gucio321.github.io/git-and-share/journal.txt

Thu Apr  3 17:40:54 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.133.07             Driver Version: 570.133.07     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 2080 ...    Off |   00000000:01:00.0  On |                  N/A |
| N/A   47C    P8              8W /   80W |     152MiB /   8192MiB |      5%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            1582      G   /usr/bin/gnome-shell                     42MiB |
|    0   N/A  N/A            2398      G   ...per --variations-seed-version         99MiB |
+-----------------------------------------------------------------------------------------+
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 8192 MB
    Total available memory: 8192 MB
    Currently available dedicated video memory: 7629 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 2080 Super with Max-Q Design/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 570.133.07
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 570.133.07
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 570.133.07
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Offline

#9 2025-04-03 21:28:22

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

Your Turing chip is pot. eligible for https://wiki.archlinux.org/title/PRIME# … Management

Apr 03 17:38:09 IUseArchBTW gnome-shell[884]: Device '/dev/dri/card1' prefers shadow buffer
Apr 03 17:38:09 IUseArchBTW gnome-shell[884]: Added device '/dev/dri/card1' (i915) using atomic mode setting.
Apr 03 17:38:09 IUseArchBTW gnome-shell[884]: Created gbm renderer for '/dev/dri/card1'
Apr 03 17:38:09 IUseArchBTW gnome-shell[884]: GPU /dev/dri/card1 selected primary from builtin panel presence
Apr 03 17:38:27 IUseArchBTW gnome-shell[1582]: Device '/dev/dri/card1' prefers shadow buffer
Apr 03 17:38:27 IUseArchBTW gnome-shell[1582]: Added device '/dev/dri/card1' (i915) using atomic mode setting.
Apr 03 17:38:27 IUseArchBTW gnome-shell[1582]: Created gbm renderer for '/dev/dri/card1'
Apr 03 17:38:27 IUseArchBTW gnome-shell[1582]: GPU /dev/dri/card1 selected primary from builtin panel presence

But some QtWebEngineProcess (falkon? Qutebrowser? guess based on "--variations-seed-version") seems to run explicitly on the GPU (prime-run?) and if the unconditioned glxinfo shows the nvidai GPU active you're running xwayland on it
=> Please post your Xorg log, https://wiki.archlinux.org/title/Xorg#General
Did you generate some xorg.conf w/ nvidia-settings or so?

Offline

#10 2025-04-04 05:50:02

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

these 2 processes using gpu explicitly are:
- brave-browser
- electron-mail
so both seems to be chromium-based (?)

also, there is no xorg log on my systtem (i did `find / -iname xorg*log`) but I'll search a bit more a bit later.

Offline

#11 2025-04-04 06:42:16

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

Both will likely be xwayland based, https://wiki.archlinux.org/title/Chromi … er_Wayland (ignore the symptoms)

ls -lR /{etc,usr/share}/X11/xorg.conf*

Offline

#12 2025-04-04 07:35:56

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

brave --ozone-plaftorm=wayland causes brave to stop working at all, but... lets skip that for now. I can get rid of chromium apps for a while and treat fixing them nice-to-have

/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

Offline

#13 2025-04-04 07:38:47

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

seth wrote:
ls -lR /{etc,usr/share}/X11/xorg.conf*

The outputclass config would not be able to steer the system towards the nvidia GPU.
Maybe the card reversal does, "nvidia_drm.modeset=1", https://wiki.archlinux.org/title/Kernel_parameters (only there, the modprobe.conf entry won't help with this)

Offline

#14 2025-04-04 08:09:04

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

[~ (0) ]$ sudo cat /sys/module/nvidia_drm/parameters/modeset 
Y

this is obviously set, but not by my bootloader.

Offline

#15 2025-04-04 12:22:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,244

Re: Temporarily disable NVIDIA Gpu (laptop)

We know, it's set by default via properties in modprobe, but setting it via the bootloader triggers an additional side effect to disable an often bothersome software GPU that can throw GPU enumeration off kilter.

Offline

#16 2025-04-04 13:17:28

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

okey, anyway, its not set by my grup:

# GRUB boot loader configuration

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 splash quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu

# Uncomment to use basic console
#GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
GRUB_TERMINAL="gfxterm"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
GRUB_GFXMODE=1920x1080x32,auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
GRUB_COLOR_HIGHLIGHT="darkred/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
GRUB_BACKGROUND="/boot/grub/themes/mytheme/terminal_c.png"
GRUB_THEME="/boot/grub/themes/mytheme/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y

# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
GRUB_DISABLE_OS_PROBER=false

Offline

#17 2025-04-04 15:08:35

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

The plan as that you add that parameter.
We also still lack the list of xorg config files.

Offline

#18 2025-04-04 15:13:40

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

I posted the only file I found above.

[~ (0) ]$ sudo find / -iname xorg.conf*
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/tmp/.mount_jetbraFtxKSr’: Permission denied
/usr/share/X11/xorg.conf.d
/home/mszeptuch/.local/share/Steam/ubuntu12_64/steam-runtime-sniper/var/tmp-PQOE12/usr/etc/X11/xorg.conf.d
/home/mszeptuch/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/var/tmp-XVIQ12/usr/etc/X11/xorg.conf.d
/home/mszeptuch/.local/share/umu/var/tmp-HNHX12/usr/etc/X11/xorg.conf.d

all other seem to be wine/steam related and not actually important.
which files exactly would you like see?

EDIT 1: I set the parameter in grub and I suppose nothing changed.

Last edited by gucio321 (2025-04-04 15:19:00)

Offline

#19 2025-04-04 15:21:47

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

You are supposed to run and post the result of this command

ls -lR /{etc,usr/share}/X11/xorg.conf*

which I now have posted thrice.
Did you regenerate the grub config? Editing /etc/default/grub does absolutely nothing by itself.

cat /proc/cmdline

Offline

#20 2025-04-04 15:29:17

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

You are supposed to run and post the result of this command

sure, I can post it but you'll see nothing more than what I posted above

/usr/share/X11/xorg.conf.d:
total 4
-rw-r--r-- 1 root root 227 Mar 20 20:53 10-nvidia-drm-outputclass.conf

Did you regenerate the grub config? Editing /etc/default/grub does absolutely nothing by itself.

Yes, I did.

BOOT_IMAGE=/vmlinuz-linux root=UUID=fde281e4-3069-4c49-9689-9cbe0919fab0 rw nvidia_drm.modeset=1 loglevel=3 splash quiet

Offline

#21 2025-04-04 15:54:45

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

You probably have neither xorg-server nor xf86-input-libinput installed?
However, that configlet does not explain the precedence of the nvidia GPU on xwayland - there *will* be some xorg log, likely Xorg.8.log

Offline

#22 2025-04-04 16:08:52

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

You probably have neither xorg-server nor xf86-input-libinput installed?

[~ (0) ]$ pacman -Q |grep -i -e xorg  -e "xf86" |xclip
lib32-libxxf86vm 1.1.5-2
libxxf86vm 1.1.6-1
xorg-fonts-100dpi 1.0.4-3
xorg-fonts-75dpi 1.0.4-2
xorg-fonts-alias-100dpi 1.0.5-1
xorg-fonts-alias-75dpi 1.0.5-1
xorg-fonts-encodings 1.1.0-1
xorg-iceauth 1.0.10-1
xorg-server-common 21.1.16-1
xorg-server-xvfb 21.1.16-1
xorg-setxkbmap 1.3.4-2
xorg-xauth 1.1.4-1
xorg-xdpyinfo 1.3.4-2
xorg-xeyes 1.3.0-2
xorg-xinit 1.4.4-1
xorg-xinput 1.6.4-2
xorg-xkbcomp 1.4.7-1
xorg-xmodmap 1.0.11-2
xorg-xprop 1.2.8-1
xorg-xrandr 1.5.3-1
xorg-xrdb 1.2.2-2
xorg-xset 1.2.5-2
xorg-xwayland 24.1.6-1
xorgproto 2024.1-2

However, that configlet does not explain the precedence of the nvidia GPU on xwayland - there *will* be some xorg log, likely Xorg.8.log

I'm also sure that xorg  log must be somewhere here but... It deffinitly isn't called xorg*log

sudo find / -iname xorg*log

Offline

#23 2025-04-08 09:34:28

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

update: after https://bbs.archlinux.org/viewtopic.php?id=304791
I reinstalled nvidia-open driver (and maybe did a couple of different things but I can't say what exactly xd)

Now something changed here as well:

Tue Apr  8 11:33:29 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.133.07             Driver Version: 570.133.07     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 2080 ...    Off |   00000000:01:00.0  On |                  N/A |
| N/A   63C    P5             25W /   80W |    1365MiB /   8192MiB |     31%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            1553      G   /usr/bin/gnome-shell                     42MiB |
|    0   N/A  N/A            3023    C+G   /usr/bin/gnome-calendar                   6MiB |
|    0   N/A  N/A            7919    C+G   ...oaded\Public\Warframe.x64.exe       1301MiB |
+-----------------------------------------------------------------------------------------+
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 25.0.3-arch1.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 25.0.3-arch1.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 25.0.3-arch1.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

Offline

#24 2025-04-08 18:30:40

seth
Member
Registered: 2012-09-03
Posts: 62,550

Re: Temporarily disable NVIDIA Gpu (laptop)

No surprise for gnome-shell (the compositor) nor what's likely steam (runs on your GPU)
gnome-calendar looks wrong, is it running on xwayland?

GDM stores the xorg log in the system journal, I assume so will gnome-shell?
(And then just not sync it to some file)

Offline

#25 Yesterday 11:22:42

gucio321
Member
Registered: 2024-10-17
Posts: 37

Re: Temporarily disable NVIDIA Gpu (laptop)

No surprise for gnome-shell (the compositor) nor what's likely steam (runs on your GPU)
gnome-calendar looks wrong, is it running on xwayland?

I have no idea why gnome calender runs on gpu as a gnome app it should run normally. How to check if it is rnning on xwayland?

GDM stores the xorg log in the system journal, I assume so will gnome-shell?
(And then just not sync it to some file)

I've already attached my journal above so it should be there...

Anyway I think that the point now is to find out why I can't run my script (bbswitch) my nvidia from text console.

I set up xorg server and can run gnome instance on it. Then it runs only on intel. (here is my config):

[~ (0) ]$ cat /etc/X11/xorg.conf.d/10-intel.conf 
section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    BusID "PCI:0:2:0"
EndSection

And here is content of ~/.local/share/xorg/Xorg.0.log (I'm 99% sure it is a log of one of my previous X sessions not the current wayland (xwayland) one)
https://gucio321.github.io/git-and-share/xorg.log

Offline

Board footer

Powered by FluxBB