You are not logged in.

#1 2023-12-23 17:02:11

phoenix324
Member
Registered: 2023-08-23
Posts: 106

[Solved] adb server prevents Nvidia suspend

OS: Arch Linux x86_64
Host: GL65 Leopard 9SDK (REV:1.0)
Kernel: 6.6.6-zen1-1-zen
Display (AUOAF90): 1920x1080 @ 144Hz (as 960x540) [Built-in]
WM: Hyprland (Wayland)
CPU: Intel(R) Core(TM) i7-9750H (12) @ 4.50 GHz
GPU 1: Intel UHD Graphics 630
GPU 2: NVIDIA GeForce GTX 1660 Ti Mobile

I followed archwiki for nvidia-proprietry installaton and using PRIME render offload

I use this command to check nvidia state which i got from arch wiki -

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

Also on my MSI laptop these is led on power button, normally its white, but it turns orange to indicate nvidia card is active.

When i start

adb start-server

the led turns red, and the above `cat` command outputs

active

and when i kill

adb kill-server

  the led turns off and the above `cat` command outputs

suspend

I have tested this in three use-accounts,
- My main Hyprland user account
- KDE on wayland session with stock config
- Hyprland with stock config

And same rusults can be observed there.

Normally adb should not be running, but i am learning Android development, and both waydroid and android-emulator starts the `adb-server` but they don't stop the server when they are closed.

I also don't understand why adb would interact with nvidia.

Last edited by phoenix324 (2024-01-03 16:22:29)

Offline

#2 2023-12-24 13:10:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

Does it show up in "nvidia-smi"?

Offline

#3 2023-12-24 13:21:50

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

seth wrote:

Does it show up in "nvidia-smi"?


no it dosen`t show up in nvidia-smi.

Offline

#4 2023-12-30 08:00:35

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

@seth i  recently had a issue, where nvidia won't suspend ( intel+nvidia laptop ), the problem came out to be one of the dotflies repo that i had been using has a script which was at regular interval invoking `nvidia-smi` command because of which nvidia was not goint into suspend state. This command from arch-wiki `cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status` safely checks nvidia state and dosten't wake it up.

So i was thinking could it be that `adb` program is just invoking nvidia in some way and dosen't let it go into suspend state as `nvidia-smi` output is dosen't show any programs using nvidia.

Offline

#5 2023-12-30 21:43:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

If the runtime_status never changes while adb is running but does once you stop it, that's a fair assumption.

My best guess would be that adb actually runs on xwayland and the xwayland server causes this.
=> What /does/ show up in nvidia-smi while adb is running and can you reproduce the behavior in an X11 session?

Offline

#6 2024-01-01 11:32:23

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

seth wrote:

My best guess would be that adb actually runs on xwayland and the xwayland server causes this.

Couldn't find any way to check this. Method on Arch-wiki are for verifying if applications(gui's)  are running under x-wayland.



seth wrote:

What /does/ show up in nvidia-smi while adb is running

`adb` is not listed under `nvidia-smi`

[phoenix@ArchLinux ~]$ nvidia-smi 
Mon Jan  1 16:57:33 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| 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 GTX 1660 Ti     Off | 00000000:01:00.0 Off |                  N/A |
| N/A   41C    P8               5W /  80W |      1MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
seth wrote:

can you reproduce the behavior in an X11 session

yes its happening there too. I checked with `xeyes` to verify that i was in `plasma-x11`

Offline

#7 2024-01-02 04:14:16

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

i just experimented trying to run applications that use x-wayland. Spotify, Freetube, Anki ---> all of them were triggering nvidia to wake up, and after few seconds nvidia would go to sleep.

Also i have 1660Ti,  where this bug appears. I had someone who had 3050 and for him this bug wasn't there.

Is these a way to check if a proccess is using x-wayland? and any way to force wayland on them?

Offline

#8 2024-01-02 15:59:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

I don't see where https://archlinux.org/packages/extra/x8 … oid-tools/ would have any dependency on any display server at all.
1660Ti is a turing chip where RTD3 has to be explicitly enabled, 3050 is an Ampere chip where this is the default.
https://wiki.archlinux.org/title/PRIME# … Management

power/control remains "auto" at all times?

Offline

#9 2024-01-03 01:08:44

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

seth wrote:

power/control remains "auto" at all times?

Yes it is `auto` all the time.



[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_status 
suspended
[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/control 
auto

[phoenix@ArchLinux ~]$ adb start-server 
* daemon not running; starting now at tcp:5037
* daemon started successfully
[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_status 
active
[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/control 
auto

[phoenix@ArchLinux ~]$ adb kill-server 
[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_status 
suspended
[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/control 
auto

Offline

#10 2024-01-03 08:49:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

strace -o /tmp/adb_server.strace -f -tt adb start-server
grep -i power /tmp/adb_server.strace # but that's a random guess, in doubt upload the strace - and of course feel free to look at it ;)

Offline

#11 2024-01-03 09:24:03

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

I Couldn't find anything useful from the strace ( my first time using strace ). Here's the output - https://0x0.st/H61c.txt

Offline

#12 2024-01-03 09:29:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

Does the GPU come w/ an usb controller?

lsusb -tvv

Offline

#13 2024-01-03 09:31:25

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

seth wrote:

Does the GPU come w/ an usb controller?

lsusb -tvv
[phoenix@ArchLinux ~]$ lsusb -tvv
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    /sys/bus/usb/devices/usb1  /dev/bus/usb/001/001
    |__ Port 007: Dev 002, If 0, Class=Vendor Specific Class, Driver=rtsx_usb, 480M
        ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
        /sys/bus/usb/devices/1-7  /dev/bus/usb/001/002
    |__ Port 009: Dev 022, 12M
        ID 1038:1122 SteelSeries ApS 
        /sys/bus/usb/devices/1-9  /dev/bus/usb/001/022
    |__ Port 014: Dev 005, If 0, Class=Wireless, Driver=btusb, 12M
        ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
        /sys/bus/usb/devices/1-14  /dev/bus/usb/001/005
    |__ Port 014: Dev 005, If 1, Class=Wireless, Driver=btusb, 12M
        ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
        /sys/bus/usb/devices/1-14  /dev/bus/usb/001/005
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/8p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    /sys/bus/usb/devices/usb2  /dev/bus/usb/002/001
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    /sys/bus/usb/devices/usb3  /dev/bus/usb/003/001
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    /sys/bus/usb/devices/usb4  /dev/bus/usb/004/001

Offline

#14 2024-01-03 09:33:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

Sorry,

lspci -nn

Offline

#15 2024-01-03 09:35:47

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

[phoenix@ArchLinux ~]$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3ec4] (rev 07)
00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
00:02.0 VGA compatible controller [0300]: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] [8086:3e9b]
00:12.0 Signal processing controller [1180]: Intel Corporation Cannon Lake PCH Thermal Controller [8086:a379] (rev 10)
00:14.0 USB controller [0c03]: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller [8086:a36d] (rev 10)
00:14.2 RAM memory [0500]: Intel Corporation Cannon Lake PCH Shared SRAM [8086:a36f] (rev 10)
00:14.3 Network controller [0280]: Intel Corporation Cannon Lake PCH CNVi WiFi [8086:a370] (rev 10)
00:15.0 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0 [8086:a368] (rev 10)
00:15.2 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #2 [8086:a36a] (rev 10)
00:16.0 Communication controller [0780]: Intel Corporation Cannon Lake PCH HECI Controller [8086:a360] (rev 10)
00:17.0 SATA controller [0106]: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller [8086:a353] (rev 10)
00:1d.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 [8086:a330] (rev f0)
00:1d.6 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port #15 [8086:a336] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation HM470 Chipset LPC/eSPI Controller [8086:a30d] (rev 10)
00:1f.3 Audio device [0403]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
00:1f.4 SMBus [0c05]: Intel Corporation Cannon Lake PCH SMBus Controller [8086:a323] (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller [8086:a324] (rev 10)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] [10de:2191] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation TU116 High Definition Audio Controller [10de:1aeb] (rev a1)
01:00.2 USB controller [0c03]: NVIDIA Corporation TU116 USB 3.1 Host Controller [10de:1aec] (rev a1)
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU116 USB Type-C UCSI Controller [10de:1aed] (rev a1)
02:00.0 Non-Volatile memory controller [0108]: Kingston Technology Company, Inc. OM8PCP Design-In PCIe 3 NVMe SSD (DRAM-less) [2646:500c] (rev 01)
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
[phoenix@ArchLinux ~]$ 

Offline

#16 2024-01-03 09:48:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

Yes.
Add "pci-stub.ids=10de:1aec" to the kernel parameters, check that you lost one of the usb3 hubs and test adb again.

Offline

#17 2024-01-03 10:05:50

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

seth wrote:

Yes.
Add "pci-stub.ids=10de:1aec" to the kernel parameters, check that you lost one of the usb3 hubs and test adb again.


the output of `lspci -nn` shows no change ->

[phoenix@ArchLinux ~]$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3ec4] (rev 07)
00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
00:02.0 VGA compatible controller [0300]: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] [8086:3e9b]
00:12.0 Signal processing controller [1180]: Intel Corporation Cannon Lake PCH Thermal Controller [8086:a379] (rev 10)
00:14.0 USB controller [0c03]: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller [8086:a36d] (rev 10)
00:14.2 RAM memory [0500]: Intel Corporation Cannon Lake PCH Shared SRAM [8086:a36f] (rev 10)
00:14.3 Network controller [0280]: Intel Corporation Cannon Lake PCH CNVi WiFi [8086:a370] (rev 10)
00:15.0 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0 [8086:a368] (rev 10)
00:15.2 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #2 [8086:a36a] (rev 10)
00:16.0 Communication controller [0780]: Intel Corporation Cannon Lake PCH HECI Controller [8086:a360] (rev 10)
00:17.0 SATA controller [0106]: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller [8086:a353] (rev 10)
00:1d.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 [8086:a330] (rev f0)
00:1d.6 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port #15 [8086:a336] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation HM470 Chipset LPC/eSPI Controller [8086:a30d] (rev 10)
00:1f.3 Audio device [0403]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
00:1f.4 SMBus [0c05]: Intel Corporation Cannon Lake PCH SMBus Controller [8086:a323] (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller [8086:a324] (rev 10)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] [10de:2191] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation TU116 High Definition Audio Controller [10de:1aeb] (rev a1)
01:00.2 USB controller [0c03]: NVIDIA Corporation TU116 USB 3.1 Host Controller [10de:1aec] (rev a1)
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU116 USB Type-C UCSI Controller [10de:1aed] (rev a1)
02:00.0 Non-Volatile memory controller [0108]: Kingston Technology Company, Inc. OM8PCP Design-In PCIe 3 NVMe SSD (DRAM-less) [2646:500c] (rev 01)
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
[phoenix@ArchLinux ~]$ 
[phoenix@ArchLinux ~]$ cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-linux-zen root=UUID=ff5d4ba3-25ce-46cd-9bab-dc98091801b1 rw rootflags=subvol=@ loglevel=3 resume=/dev/nvme0n1p2 mitigations=off nowatchdog modprobe.blacklist=iTCO_wdt nvidia_drm.modeset=1 nvidia_drm.fbdev=1 pci-stub.ids=10de:1aec
[phoenix@ArchLinux ~]$ 

Also now nvidia is permanently in active state.

Offline

#18 2024-01-03 13:31:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

The change would happen on "lsusb -tvv", the device is still there, just (hopefully) not occupied by the xhci module (resulting in no device and therefore adb hopefully leaving it alone)
"power/control" is still on auto?

Please post your complete system journal for the boot:

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

Offline

#19 2024-01-03 14:08:23

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

seth wrote:

The change would happen on "lsusb -tvv", the device is still there, just (hopefully) not occupied by the xhci module (resulting in no device and therefore adb hopefully leaving it alone)

[phoenix@ArchLinux ~]$ lsusb -tvv
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    /sys/bus/usb/devices/usb1  /dev/bus/usb/001/001
    |__ Port 007: Dev 002, If 0, Class=Vendor Specific Class, Driver=rtsx_usb, 480M
        ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
        /sys/bus/usb/devices/1-7  /dev/bus/usb/001/002
    |__ Port 009: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 1038:1122 SteelSeries ApS 
        /sys/bus/usb/devices/1-9  /dev/bus/usb/001/003
    |__ Port 009: Dev 003, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        ID 1038:1122 SteelSeries ApS 
        /sys/bus/usb/devices/1-9  /dev/bus/usb/001/003
    |__ Port 014: Dev 005, If 0, Class=Wireless, Driver=btusb, 12M
        ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
        /sys/bus/usb/devices/1-14  /dev/bus/usb/001/005
    |__ Port 014: Dev 005, If 1, Class=Wireless, Driver=btusb, 12M
        ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
        /sys/bus/usb/devices/1-14  /dev/bus/usb/001/005
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/8p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    /sys/bus/usb/devices/usb2  /dev/bus/usb/002/001

"power/control" is still on auto?

Yes it is still on auto.

[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/control
auto



Please post your complete system journal for the boot:

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

http://0x0.st/H6jC.txt



[phoenix@ArchLinux ~]$ killall adb
adb: no process found
[phoenix@ArchLinux ~]$ cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status
active
[phoenix@ArchLinux ~]$ cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-linux-zen root=UUID=ff5d4ba3-25ce-46cd-9bab-dc98091801b1 rw rootflags=subvol=@ loglevel=3 resume=/dev/nvme0n1p2 mitigations=off nowatchdog modprobe.blacklist=iTCO_wdt nvidia_drm.modeset=1 nvidia_drm.fbdev=1 pci-stub.ids=10de:1aec

with this kernel parameter, nvidia is not going into suspend mode

Last edited by phoenix324 (2024-01-03 14:10:57)

Offline

#20 2024-01-03 14:16:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

The stub gets it and usb 3 & 4 disappeared. So it worked, just

with this kernel parameter, nvidia is not going into suspend mode

does't exactly help the situation.

You could try a udev rule instead, https://wiki.gentoo.org/wiki/Hybrid_gra … ersion_5.5

Offline

#21 2024-01-03 14:22:32

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

Out of these three which aree those that i need to do? i am on 6.6.8-zen1-1-zen

FILE /etc/modprobe.d/nvidia-pm.confEnabling dynamic power management

options nvidia \
    NVreg_DynamicPowerManagement=0x02 \
Kernels 5.5 and newer

Add the following:
FILE /lib/udev/rules.d/80-nvidia-pm.rulesAdding udev rules

# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"

# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"
Kernels prior to version 5.5

In addition to the rules added above, add the following:
FILE /lib/udev/rules.d/80-nvidia-pm.rulesAdding udev rules

# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"

Last edited by phoenix324 (2024-01-03 14:23:08)

Offline

#22 2024-01-03 14:25:22

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

Also this confuses me ->

Testing

To test if the dGPU is powering down, use the tool nvidia-smi which is part of the x11-drivers/nvidia-drivers when compiled with the tools USE flag.
user $nvidia-smi

Sun Feb  5 16:49:23 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.05    Driver Version: 525.85.05    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   46C    P8    N/A /  35W |   1001MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

The N/A / 35W in the example above indicates that the dGPU is turned off.
Points to note

Here are a few points to note:

    Executing nvidia-smi will turn the dGPU on.
    Sensor programs that probe for something like the temperature of the dGPU will turn it on.
    When the dGPU turns on it can cause stuttering.

It first says to test using `nvidia-smi` then in last paragraph it says `Executing nvidia-smi will turn the dGPU on` , then how did they get the output in nvidia-smi to be `N/A`?

Offline

#23 2024-01-03 14:29:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,404

Re: [Solved] adb server prevents Nvidia suspend

You can disregard most of that wiki, the only relevant part is the udev rules to remove the devices, the usb/xhci being the most interesting one.

ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

You can put that w/ your RTD3 rules or an extra file, doesn't matter.

As result /dev/bus/usb/00{3,4} are hopefully gone, adb doesn't open them anymore and your GPU stays asleep.

Offline

#24 2024-01-03 16:11:37

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [Solved] adb server prevents Nvidia suspend

Wow, it worked, still don't understand how did you figured it out.

Thank you so much.



SideNote - The gentoowiki was suggesting /lib/udev/rules.d/, but i instead did it in /etd/udev/rules.d

[phoenix@ArchLinux ~]$ cat /etc/udev/rules.d/80-nvidia-pm.rules 
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"


P.S - I tried editing title to indicate the `topic` is solved, but max character length is reached. I could shrink the title further more, but what is the general approach here, as shrinking title might make it less understandable and harder for other people to find this.

Last edited by phoenix324 (2024-01-03 16:14:37)

Offline

#25 2024-01-03 16:20:38

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: [Solved] adb server prevents Nvidia suspend

phoenix324 wrote:

P.S - I tried editing title to indicate the `topic` is solved, but max character length is reached. I could shrink the title further more, but what is the general approach here, as shrinking title might make it less understandable and harder for other people to find this.

[SOLVED] adb server prevents Nvidia suspend

Or something like that... wink


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

Board footer

Powered by FluxBB