Thinkpad P14s Gen 3 (12th Gen Intel i7-1260P)

Without persistence mode I cannot set the power limit, it simply does not do anything and it remains on 30 W. After pm=1 the power limit is set fine. Another thing.. After reboot I cannot set persistence mode at all - all I get is segfault:

Aug 23 13:02:12 freebsd kernel: Fatal trap 12: page fault while in kernel mode
Aug 23 13:02:12 freebsd kernel: cpuid = 5; apic id = 11
Aug 23 13:02:12 freebsd kernel: fault virtual address = 0x4598
Aug 23 13:02:12 freebsd kernel: fault code = supervisor read data, page not present
Aug 23 13:02:12 freebsd kernel: instruction pointer = 0x20:0xffffffff83cb5bcb
Aug 23 13:02:12 freebsd kernel: stack pointer = 0x28:0xfffffe011e512d40
Aug 23 13:02:12 freebsd kernel: frame pointer = 0x28:0xfffffe012144b000
Aug 23 13:02:12 freebsd kernel: code segment = base 0x0, limit 0xfffff, type 0x1b
Aug 23 13:02:12 freebsd kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Aug 23 13:02:12 freebsd kernel: processor eflags = interrupt enabled, resume, IOPL = 0
Aug 23 13:02:12 freebsd kernel: current process = 0 (nvidia taskq)
Aug 23 13:02:12 freebsd kernel: trap number = 12
Aug 23 13:02:12 freebsd kernel: panic: page fault
Aug 23 13:02:12 freebsd kernel: cpuid = 5
Aug 23 13:02:12 freebsd kernel: time = 1692792050
Aug 23 13:02:12 freebsd kernel: KDB: stack backtrace:
Aug 23 13:02:12 freebsd kernel: #0 0xffffffff80c53dc5 at kdb_backtrace+0x65
Aug 23 13:02:12 freebsd kernel: #1 0xffffffff80c06741 at vpanic+0x151
Aug 23 13:02:12 freebsd kernel: #2 0xffffffff80c065e3 at panic+0x43
Aug 23 13:02:12 freebsd kernel: #3 0xffffffff810b1fa7 at trap_fatal+0x387
Aug 23 13:02:12 freebsd kernel: #4 0xffffffff810b1fff at trap_pfault+0x4f
Aug 23 13:02:12 freebsd kernel: #5 0xffffffff81088e78 at calltrap+0x8
Aug 23 13:02:12 freebsd kernel: Uptime: 1m5s
Aug 23 13:02:12 freebsd kernel: ---<<BOOT>>---

Tried kldload after boot, kldload nvidia and nvidia-modeset, nothing works. nvidia-smi pm=1 immediately sends the system into the kernel panic.
 
On my FrankendPad i have adjusted screen brightness l in /etc/sysctl.conf and set
hw.acpi.video.lcd0.economy=30 - on battery
hw.acpi.video.lcd0.fullpower=60 - on DC

On idle my laptop was using between 3.7 to 5.5W on idle ...
Try to disable webcam and if you have touch screen, express card if you have. Some thing you dont need try to disable them trough BIOS or Xorg etc and have a look at the power consumptions.
P.s. have a look AT THIS.
As people use PRIME for it - link i provided set up on Prime as well.
 
  • Thanks
Reactions: mro
Gents, I stand corrected. nvidia-smi pl=1 without pm=1 works. Persistence mode is not required. For some reason I have issued the pl=1 command and nvidia-smi -q was still showing that the limit wasn't set. I am still not sure why sometimes it does set it fine and sometimes completely ignores the command.

GlitchyDot, thanks for the recommendations. hw.acpi.video controls are not available on P14s. PRIME doesn't work either.
 
Yes. By the way, without persistence it appears that the Nvidia card resets the power limit, so no joy there as well.

Update: if nvidia-smi is run in the daemon mode then it keeps the power limit. I have been able to decrease the power usage of the Nvidia card down to 2-3 W by forcing the power limit and also setting the clocks to the minimum:

sudo nvidia-smi daemon
sudo nvidia-smi -pl=1
sudo nvidia-smi -ac=405,300
sudo nvidia-smi -lgc=300,300

So, now down to 13W total power consumption.
 
First of all, try 13.2-Release, not 13.1-Release.
Maybe 13.1 doesn't have AlderLake workaround.
If it does not stable enough, try adding

vm.pmap.pcid_enabled=0

in /boot/loader.conf. as it is a tunable, adding it in /etc/sysctl.conf should not work.

And the second. Do you have "Descrete Graphics" or "Nvidia Descrete Graphics" option in UEFI BIOS? If so, try enabling it.
If not, try installing graphics/nvidia-drm-kmod.
Another way could be x11/nvidia-hybrid-graphics.

Beware! I myself enable Descrete Graphics in UEFI BIOS of ThinkPad P52 and using x11/nvidia-driver. Neither graphics/nvidia-drm-kmod nor x11/nvidia-hybrid-graphics is tried on my hand.

For network related devices, hopefully 13.2 has more fixes (and stable/13 would have still more not yet MFS'ed, if I recall correctly) than 13.1.
 
Thanks, T-Aoki. I am running FreeBSD 13.2 already, so the Alder Lake cache invalidation workaround (pcid_enabled=0) shouldn't be required. It is pretty stable overall, not considering occasional kernel panics from the built-in Wi-Fi. No discrete graphics options in BIOS, you cannot switch GPUs from there in this laptop.
 
So you cannot use x11/nvidia-driver alone. Additionally needs graphics/nvidia-drm-kmod or x11/nvidia-hybrid-graphics. Both of which would pull in additionally required ports/pkgs.
And acpi_video.ko (included in base) should be read AFTER other graphics kmods. IIRC, I read someware (in Japanese) claiming that if acpi_video.ko is read BEFORE any DRM-related kmods, backlight forcibly turned off and does not turn on again without reboot. It could be (usually) achieved specifying acpi_video.ko as the last item of kld_list in /etc/rc.conf. Not in /boot/loader.conf.
 
Loading acpi_video.ko via rc.conf results in dev.acpi_ibm.0.lcd_brightness appearing with the zero value after boot, but the screen doesn't react on any changes to this value.
 
is dev.acpi_ibm.0.events set to 1 to enable acpi events?
Also check dev.acpi_ibm.0.availmask if controlling the lcd via acpi is supported on that model. IIRC lenovo now often uses some proprietary interface for various functions, which requires some windows-software or a specific driver.
 
Yes, maybe depends on firmware version and/or model.
If I recall correctly, ThinkPas T61 worked fine for brightness, but T420 and P52 does not. For P52, dev.acpi_ibm.0.events: 1 and dev.acpi_ibm.0.availmask: 4294967291.
 
Yes, maybe depends on firmware version and/or model.
If I recall correctly, ThinkPas T61 worked fine for brightness, but T420 and P52 does not. For P52, dev.acpi_ibm.0.events: 1 and dev.acpi_ibm.0.availmask: 4294967291.

4294967291is 0xFFFFFFFB
which is NOT 0x00000004
where 0x04 is LCD Backlight.

T430s here, same NOT Backlight control, however devd can catch Brightness up & down keys, so I'm looking to get that working, since acpi_video.ko is working for me via loader.conf to set fullpower and economy levels, and via a (root) script to set any brightness level.

Might be worth you trying again, given you may need to load it even later? If in rc.conf kld_list, put it last after any video stuff.

If that's still too early you could try kldloading it in /etc/rc.local.

To test, you could check if
# kldunload acpi_video
# kldload acpi_video
enables brightness after boot.
 
Loading acpi_video.ko via rc.conf results in dev.acpi_ibm.0.lcd_brightness appearing with the zero value after boot, but the screen doesn't react on any changes to this value.

Sorry, my previous response to T-Aoki was meant more for you. I've just caught up on the whole thread a bit better.

Loading acpi_video is not related to acpi_ibm, its oid is
hw.acpi.video.lcd0.brightness (values 0-100)
so changing dev.acpi_ibm.0.lcd_brightness, if it didn't work before, still won't.

Given you load it late enough, what says sysctl hw.acpi.video ?
Does it work setting e.g:
# sysctl hw.acpi.video.lcd0.brightness=50

And what is your dev.acpi_ibm.0.availmask ?
 
Hi smithi,

Sorry! hw.acpi.video.lcd0.brightness doesn't appear in sysctl at all.

dev.acpi_ibm.0.availmask: 4294967291
 
I am loading acpi_video at the bottom of rc.conf via:
kld_list="$kldlist acpi_video"

% kldstat | grep acpi_video
39 1 0xffffffff83b20000 4350 acpi_video.ko

sysctl -a | grep hw.acpi.video produces no output.
 
% sysctl -a | fgrep acpi | fgrep video
hw.acpi.reset_video: 0

A bit long though, but my `kldstat` is like below.
The last component in kldlist is acpi_video.ko as blackhaz.
Everything after acpi_video.ko is autoloaded via devd.

% kldstat
Id Refs Address Size Name
1 203 0xffffffff80200000 1d378a0 kernel
(snip)
9 1 0xffffffff81fe3000 8260 acpi_ibm.ko
(snip)
33 1 0xffffffff83f50000 11e650 nvidia-modeset.ko
34 1 0xffffffff84200000 339f278 nvidia.ko
5 2 0xffffffff8406f000 2fa10 linux.ko
36 6 0xffffffff8409f000 be70 linux_common.ko
37 1 0xffffffff840ab000 4388 acpi_video.ko
38 1 0xffffffff840b0000 3390 acpi_wmi.ko
39 2 0xffffffff840b4000 22cc hconf.ko
40 1 0xffffffff840b7000 21e8 hcons.ko
41 4 0xffffffff840ba000 40a8 hidmap.ko
42 1 0xffffffff840bf000 21e8 hms.ko
43 1 0xffffffff840c2000 3355 hmt.ko
44 1 0xffffffff840c6000 21e8 hpen.ko
45 1 0xffffffff840c9000 21e8 hsctrl.ko
46 1 0xffffffff840cc000 3250 ichsmb.ko
47 1 0xffffffff840d0000 871d0 if_iwlwifi.ko
48 1 0xffffffff84158000 2110 pchtherm.ko
49 1 0xffffffff8415b000 d200 rtsx.ko
50 1 0xffffffff84169000 2cc30 linux64.ko
51 1 0xffffffff84196000 2278 pty.ko
52 1 0xffffffff84199000 73c0 linprocfs.ko
53 1 0xffffffff841a1000 440c linsysfs.ko
54 2 0xffffffff841a6000 4248 vboxnetflt.ko
55 8 0xffffffff841ab000 abb8 netgraph.ko
56 1 0xffffffff841b6000 31e0 ng_ether.ko
57 1 0xffffffff841ba000 55f0 vboxnetadp.ko
58 1 0xffffffff841c0000 27450 ipfw.ko
59 1 0xffffffff841e8000 4d20 ng_ubt.ko
60 2 0xffffffff841ed000 9250 ng_hci.ko
61 4 0xffffffff841f7000 2670 ng_bluetooth.ko
62 1 0xffffffff875a0000 d268 ng_l2cap.ko
63 1 0xffffffff875ae000 1af68 ng_btsocket.ko
64 1 0xffffffff841fa000 38f8 ng_socket.ko
65 1 0xffffffff875c9000 e5ac snd_uaudio.ko
 
I am loading acpi_video at the bottom of rc.conf via:
kld_list="$kldlist acpi_video"

% kldstat | grep acpi_video
39 1 0xffffffff83b20000 4350 acpi_video.ko

Edit: perhaps adding
verbose_loading="YES"
to /boot/loader.conf might drop a clue to dmesg.boot?

sysctl -a | grep hw.acpi.video produces no output.

Hmm. Last stab in the dark:

If that's still too early you could try kldloading it in /etc/rc.local.

To test, you could check if
# kldunload acpi_video
# kldload acpi_video
enables brightness after boot.
 
Unloading and loading acpi_video manually after boot doesn't help either.
+1. Before and after kldunload / kldload,

% sysctl -a | fgrep acpi | fgrep video
hw.acpi.reset_video: 0


FYI:
Not sure how it works, but if you are using Mate DE as your desktop, brightoness control in mate-applets would be your friend.
Using this applet, I can control brightness. But Fn+F5/F6 does not work.
 
Unloading and loading acpi_video manually after boot doesn't help either.
+1. Before and after kldunload / kldload,

% sysctl -a | fgrep acpi | fgrep video
hw.acpi.reset_video: 0

Can't see why you're showing hw.acpi.reset_video here ("Call the VESA reset BIOS vector on the resume path"). No reason it would be set (1) though you can set it for some resume issues.

hw.acpi.video.lcd0.active=1 here, where setting .brightness works. It's read-only once set.

FYI:
Not sure how it works, but if you are using Mate DE as your desktop, brightoness control in mate-applets would be your friend.
Using this applet, I can control brightness. But Fn+F5/F6 does not work.

If any program can control brightness, it's just a matter of finding out how it's being done. Do you have Mate source code?

Does the Mate applet need hw.acpi_video to be loaded? If not, it's something different.

But if so, does (as root) setting sysctl hw.acpi.video.lcd0.brightness=50 or 30 or 70 work?

Another thing to note is that hw.acpi.video.lcd0.levels has values '100 100 0 1 2 3 ... 97 98 99 100' so even if your FnF5/F6 keys work they may only inc/dec value by 1 at a time, virtually unnoticeable.

I can't find it just now, but I found a script that a) uses devd notifies to hook the FN keys and b) inc/decreases brightness by 5 or so per press. I'll report here if I find it - but it does need to poke hw.acpi.video.lcd0.brightness.
 
Back
Top