User:Trickygnome/Lenovo Legion 5
Cheep gaming AMD CPU based laptop of 2020 with Nvidia video card. The best balance of price and quality.
Flaws:
- week screen mounting
- big charger
Hardware
- GPU - works.
- Audio - works.
- Ethernet (RJ-45) - works without firmware.
- Wireless - works with firmware.
- Touchpad - works.
- Keyboard function keys - fully works.
- Bluetooth - not works without Wi-Fi chip.
- Webcam - Untested.
Kernel version 6.12.21.
Upgrade slots
- M.2 2242 SSD - PCIe® NVMe®, PCIe 3.0 x4
- M.2 2280 SSD - PCIe NVMe, PCIe 3.0 x4
- M.2 Wi-Fi card
CPU
Mobile processor with 8 cores,
AMD Simultaneous Multithreading (SMT) the core-count is effectively doubled, to 16 threads
Jan 6th, 2020
Generation: Ryzen 7 (Zen 2 (Renoir)) Family 17h
Codename: Renoir
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 7 4800H with Radeon Graphics
CPU family: 23
Model: 96
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 1
Frequency boost: enabled
CPU(s) scaling MHz: 96%
CPU max MHz: 2900.0000
CPU min MHz: 1400.0000
BogoMIPS: 5791.44
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid extd_apicid a
perfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext
perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 c
qm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vm
load vgif v_spec_ctrl umip rdpid overflow_recov succor smca
Virtualization features:
Virtualization: AMD-V
Caches (sum of all):
L1d: 256 KiB (8 instances)
L1i: 256 KiB (8 instances)
L2: 4 MiB (8 instances)
L3: 8 MiB (2 instances)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Memory
ECC Memory: No
PCI-Express: Gen 3
Frequency: 2.9 GHz Turbo Clock: up to 4.2 GHz
System Memory Type: DDR4 - Up to 3200, LPDDR4 - Up to 4266
GPU
NVIDIA GeForce RTX 2060 Movile rev 1a
Jan 15, 2019 https://en.wikipedia.org/wiki/GeForce_20_series
Architecture: Turing
6GB GDDR6
Ray Tracing Cores: 1st Gen
Tensor Cores: 2nd Gen
CUDA CORES 1920
PCI Express x16 3.0
PCI - ISA - bridge
+-----------------------------------------------------------------------------------------+
| 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 2060 Off | 00000000:01:00.0 On | N/A |
| N/A 45C P8 9W / 80W | 141MiB / 6144MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 2747 G sway 108MiB |
+-----------------------------------------------------------------------------------------+
Kernel
Modification of Live CD /proc/config.gz
.
- Procesor type and features
- [*] Support x2apic (dmesg | grep -i x2apic) - depends on “Linux guest support”
- [*] x86 CPU resource control support
- [*] AMD ACPI2Platform devices support - may be disabled if you don't need GPIO
- [ ] Intel SoC IOSF Sideband support for SoC platforms
- [*] Linux guest support - for virtualization
- [ ] Enable MPS table - old
- [ ] Support for extended (non-PC) platforms
- [*] AMD ACPI2Platform devices support CONFIG_X86_AMD_PLATFORM_DEVICE - not shure
- [ ] Linux guest support - You don't need to enable this option if you're building a kernel to run directly
on hardware or as a host for other virtual machines
- [*] Cluster scheduler support
- [ ] CPU core priorities scheduler support
- [ ] Reroute for broken boot IRQs - not shure.
- [*] Machine Check / overheating reporting
- [*] AMD MCE features
- [ ] Intel MCE features
- [ ] Memory Protection Keys
- Performanc monitoring
- [*] Inte/Amd ramp performance events
- [ ] AMD processor power reporting mechanism
- [*] AMD Uncore performance events
- [ ] AMD Zen3 Branch Sampling support
- [ ] IOPERM and IOPL Emulation
- [ ] Enavle 5-level page tables support
- [ ] AMD Secure Memory Encryption (SME) support
- [ ] NUMA Memory Allocation and Scheduler Support
- [ ] EFI runtime service support - required for UEFI boot
- [ ] EFI handover protocol
- [ ] EFI mixed-mode support
- [ ] Disable the 32-bit vDSO
- [ ] none - vsyscall table for legacy applications
- Mitigations for CPU vulnerabilities - use “lscpu” command
- [*] Remove the kernel mapping in user mode - not shure
- [*] Avoid speculative indirect branches in kernel
- [*] Enable return-thunks
- [*] Enable UNRET on kernel entry
- [ ] Mitigate RSB underflow with call depth tracking
- [*] Enable IBPB on kernel entry
- [ ] Enable IBRS on kernel entry - great cost to performance, required but I disabled
- [*] Mitigate speculative RAS overflow on AMD
- [*] Mitigate Straight-Line-Speculation
- [ ] Force GDS Migitation - gather data sampling
- [ ] RFDS Mitigation
- [*] Mitigate Spectre-BHB
- Power management and ACPI options
- [*] Energy Model for devices with DVFS (CPUs, GPUs, etc) - not shure
- [*] ACPI advanced...
- <*> Processor Aggregator
- CPU Frequency scaling
- [*] CPU frequency fransition statistics - required for conroling governor
- [*] AMD Processor P-State driver
- [*] ACPI Processor P-States driver - not shure, I guess not supported
- [*] AMD frequency sensitive feedback powersave bias - family 16 and above (17)
- Binary Emulation
- [ ] IA32 Emulation
- General architecture-dependent options
- [*] Use a virtually-mapped stack
- Memory Management options
- [*] Multi-Gen LRU - recommended
- [*] Enable loadable module support - require for nvidia-drivers
- [*] Networking support --->
- Networking options
- [*] Packet socket - required for some wifi drivers
- [*] RF switch subsystem support
- Wireless --->
- <*> cfg80211 - wireless configuration API
- [*] enable powersave by default
- <*> Generic IEEE 802.11 Networking Stack (mac80211)
- Device Drivers
- PCI support
- [*] PCI IOV support - not shure, if IO virtualization is supported, there are also useful “PCI Stub” and “PCI PF stub”
- [ ] PCCard (PCMCCIA/...) support
- NVME Support --->
- <*> NVM Express block device
- [*] NVMe multipath support
- [ ] Serial ATA and Parallel Ata -> or [ ] AHCI SATA
- I2C support --->
- [*] ACPI I2C Operation region support - enabled by default idk
- [*] Autoselect pertinent helper modules - not shure
- I2C Hardware Bus support --->
- <*> Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC
- <*> NVIDIA GPU I2C controller
- <*> SMBus Control Method Interface
- SYNA2BA6
- Generic Driver Options
- [*] Use nosuid, noexec mount options on devtmfs - enhance security but may hurt Nvidia-drivers
- [*] X86 Platform Specific Device Drivers --->
- <*> Lenovo IdeaPad Laptop Extras
- < > WMI
- [ ] Macintosh device drivers
- [*] IOMMU Hardware Support --->
- [*] AMD IOMMU support
- <*> AMD IOMMU Version 2 driver
- [*] Support for Interrupt Remapp
- Character devices
- [*] IPMI top level message handler - required for Nvidia-drivers
- Hardware Monitoring support
- <*> AMD Family 10h+ temerature sensor
- Input device support
- [*] Mouse interface
- [*] Keyboards
- [*] AT keyboard
- [*] Mice
- [*] PS/2 mouse
- HID bus support
- Special HID drivers - disable all for speed
- [*] HID Multitouch panels
- [*] I2C HID support
- Network device support
- Ethernet driver support - disable all for speed
- [*] Realtek devices
- [*] Realtek 8169/8168/8125 ethernet support
- Wireless LAN - disable all for speed
- [*] Watchdog Timer Support
- <*> AMD/ATI SP5100 TCO Timer/Watchdog
- [*] USB support
- [ ] UHCI HCD (most Intel and VIA) support
- <*> USB Type-C Support --->
- <*> USB Type-C Port Controller Manager
- <*> Type-C Port Controller Interface driver
- <*> USB Type-C Connector System Software Interface driver
- <*> UCSI ACPI Interface Driver
- USB Type-C Alternate Mode drivers --->
- <*> DisplayPort Alternate Mode driver
- [*] USB Gadget Support - for able to connect USB-SATA-adapter
- [*] USB Gadget function configurable through configfs - for able to connect USB-SATA-adapter
- Multiple devices driver support (Raid and LVM)
- [*] Crypt target support - for LUKS
- Graphics support --->
- Backlight & LCD device suppot --->
- [*] Low level Backlight control - required of “Lenovo IdeaPad Laptop Extras”
- Direct Rendering Manager --->
- [*] Enable legacy fbdev suppor for your modesetting driver - needed for nvidia-drm.fbdev=1
- [M] AMD GPU - OR - Nouveau - OR - QXL virtual GPU
- [*] Trusted Execution Environment support
- File systems
- [*] Btrfs
- Pseudo filesystems
- [*] EFI Variable filesystem - reqired for UEFI boot
- DOS/FAT/EXFAT/NT Filesystems --->
- <*> VFAT (Windows-95) fs support
- (437) Default codepage for FAT
- (iso8859-1) Default iocharset for FAT (or ascii)
- Native language support
- NLS ISO 8859-1 - for EFI
- Cryptographic API
- Crypto core or helpers
- [ ] Disable run-time self tests
- <*> Parallel crypto engine
- <*> Software async crypto daemon
- [?] Hardware crypto devices
- [?] Support for AMD Secure Processor - can be backdoor, closed sourced code.
- Compression
- [*] Zstd
- Length-preserving ciphers and modes --->
- <*> XTS (XOR Encrypt XOR with ciphertext stealing)
- Length-preserving ciphers and modes --->
- <*> XTS (XOR Encrypt XOR with ciphertext stealing)
- Kernel hacking
- [*] Filter I/O access to /dev/mem
Install CD Kernel modules
- cfg80211 - Network support ---> Wireless - <M> cfg80211 - requred for Wifi
- 8021q - netfilter configuration - OPTIONAL
- garp
- mrp
- stp
- llc
- binfmt_misc - Executable file formats ---> <M> Kernel support for MISC binaris - OPTIONAL
- amd_atl - Device Drivers --> Reliability, Availability and Serviceability - <M> AMD Address Translation Library
- soundwire_amd - Device Drrivers -> SoundWire support -> AMD SoundWire manager driver
- soundwire_generic_allocation - ???
- soundwire_bus - ???
- snd - Device Drrivers -> Sound card support --> Advanced Linux
- snd_soc_core - Device Drrivers -> Sound card support --> Advanced Linux -> ALSA for SoC ->
- ac97_bus - Device Drrivers -> Sound card support --> Advanced Linux -> Generic sound devices -> AC 98 Power-Savint - not shure
- snd_compress - ??
- snd_pcm
- snd_timer - ??
- snd_pcm_dmaengine
- snd_pci_acp6x - AMD Audio Coprocessor -v6.x Yellow Carp support
- snd_pci_acp5x - AMD Audio Coprocessor -v5.x I2S support
- snd_pci_acp3x - AMD Audio Coprocessor -v3.x support
- snd_acp_config
- snd_soc_acpi
- snd_amd_sdw_acpi - CONFIG_SND_SOC_SDW_UTILS
- snd_pci_ps - CONFIG_SND_SOC_AMD_PS_MARCH - Device Drrivers -> Sound card support --> Advanced Linux -> ALSA for SoC -> AMD Audio Coprocessor-v6.3 Pink Sardine support
- snd_rpl_pci_acp6x
- snd_rn_pci_acp3x
- snd_sof - Device Drrivers -> Sound card support --> Advanced Linux -> ALSA for SoC -> Sound Open Firmware Support
- snd_sof_pci - SOF PCI enumeration support
- snd_sof_amd_rembrandt - SOF support for REMBRANDT
- snd_sof_amd_vangogh - SOF support for VANGOGH
- snd_sof_amd_renoir - SOF support for RENOIR
- snd_sof_amd_acp - SOF support for AMD audio DSPs - ???
- snd_sof_utils - ???
- snd_xtensa_dsp - ???
- snd_intel_dspcfg
- snd_hda_core
- snd_hwdep - Device Drrivers -> Sound card support --> Advanced Linux -> HD Audio -> [M] Build hwdep interface
- snd_hda_codec
- snd_hda_intel - Device Drrivers -> Sound card support --> Advanced Linux -> HD Audio -> HD Audio PCI
- snd_hda_code_realtek
- snd_hda_code_component
- snd_hda_code_generic
- snd_hda_code_hdmi - Device Drivers -> Sound card support --> Advanced Linux -> HD Audio -> Build HDMI/DisplayPort HD-audio codec support
- ee1004 - Device Drivers -> Misc devices -> EEPROM support -> SPD EEPROMs on DDR4 memory
- mc
- videodev
- uvc - Device Drivers -> Media support -> Media drivers - Media USB Adapters -> USB Video Class (UVC)
- uvcvideo
- videobuf2_malloc - Webcam
- videobuf2_memops
- videobuf2_v4l2
- videobuf2_common
- SP5100_tco - Device Drivers -> Watchdog Timer Support -> <M> AMD/ATI SP5100 TCO Timer/Watchdog
- typec - [*] USB support -> <*> USB Type-C Support
- typec_ucsi - [*] USB support -> <*> USB Type-C Support ---> <M> USB Type-C Connector System Software Interface drive
- ucsi_ccg - [*] USB support -> <*> USB Type-C Support ---> <M> UCSI Interface Driver for Cypress CCGx - probe with driver ucsi_ccg failed with error - 110
- ucsi_acpi - [*] USB support -> <*> USB Type-C Support ---> <M> UCSI ACPI Interface Driver
- sparse_keypam - Device Drivers -> Input device support -> {M} Sparse keymap support library
- platform_profile - Power management and ACPI options -> ACPI (Advanced Configuration ... ) -> HIDDEN
- ideapad_laptop - X86 Platform Specific Device Drivers ---> <*> Lenovo IdeaPad Laptop Extras
- video - Power management and ACPI options -> ACPI (Advanced Configuration ... ) -> <M> Video
- wmi - X86 Platform Specific Device Drivers ---> <*> WMI
- wmi_bmof - X86 Platform Specific Device Drivers ---> <*> WMI embedded Binary MOF driver
- rapl - Processor type and features -> Performance monitoring ---> <M> Intel/AMD rapl performance events
- intel_rapl_msr -?
- intel_rapl_common -?
- joydev - Device Drivers -> Input device support -> Joystick interface
- r8169 - Device Drivers -> Network device support -> Ethernet driver support -> Realtek devices Realtek 8169 Ethernet
- ccp - Cryptographic API -> Hardware crypto devices -> Support for AMD Secure Processor _> Secure Processordevice driver
- pcspkr - Device Drivers -> Input device support -> Generic input layer -> Miscellaneous devices -> PC Speaker support
- serio_raw - Device Drivers -> Input device support -> Hardware I/O ports -> Raw access to serio ports
- acpi_cpufreq - Power management and ACPI options -> CPU Frequency scaling -> CPU Frequency scaling -> ACPI Processor P-States driver
- k10temp - Device Drivers -> Hardware Monitoring support -> <M> AMD Family 10h+ temperature sensor
- i2c_piix4 - Device Drivers -> I2C support -> I2C hardware Bus support - <M> Intel PIIX4 and campatible
- i2c_smbus - Device Drivers -> I2C support -> HIDDEN
- i2c_nvidia_gpu - Device Drivers -> I2C support -> I2C hardware Bus support - <M> NVIDIA GPU I2C controller
- i2c_hid_acpi - Device Drivers -> HID bus support -> I2C HID support -> HID over I2C transport
- i2c_hid
- hid_multitouch - Device Drivers -> HID bus support -> Special HID drivers -> [*] HID Multitouch panels
- edac_mce_amd - Device Drivers -> EDAC (Error Detection and Correction) -> <M> DECODE MCEs in human-readeable && <M> AMD64 (Opter, Athlon64)
Bash aliases
/root/.bash_aliases
CPU power managementalias perf="echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
alias power="echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ; br9"
alias pond="echo ondemand | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
alias pcon="echo conservative | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
alias pget="echo perf, power, pond, pcon, pav ; cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
alias pav="cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors"
/root/.bash_aliases
Brightness of screenalias br1="echo "5" > /sys/class/backlight/nvidia_0/brightness"
alias br2="echo "10" > /sys/class/backlight/nvidia_0/brightness"
alias br3="echo "20" > /sys/class/backlight/nvidia_0/brightness"
alias br4="echo "30" > /sys/class/backlight/nvidia_0/brightness"
alias br5="echo "40" > /sys/class/backlight/nvidia_0/brightness"
alias br6="echo "50" > /sys/class/backlight/nvidia_0/brightness"
alias br7="echo "60" > /sys/class/backlight/nvidia_0/brightness"
alias br8="echo "70" > /sys/class/backlight/nvidia_0/brightness"
alias br9="echo "80" > /sys/class/backlight/nvidia_0/brightness"
alias br0="echo "90" > /sys/class/backlight/nvidia_0/brightness"
alias br-="echo 100 > /sys/class/backlight/nvidia_0/brightness"
/root/.bash_aliases
Batteryba ( ) {
echo -e "Full design \t" $(($(cat /sys/class/power_supply/BAT0/energy_full_design) / 1000000))
echo -e "Energy_full\t" $(($(cat /sys/class/power_supply/BAT0/energy_full) / 1000000))
echo -e "Now\t\t " $(($(cat /sys/class/power_supply/BAT0/energy_now) / 1000000))
cat /sys/class/power_supply/BAT0/status
}
/root/.bash_aliases
Statusget-status ( ) {
echo $(cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor) ba: $(source /root/bat.sh) temp_nv: $(source /root/gettemp.sh) $(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)
}
/root/bat.sh
#!/usr/bin/env bash
python -c "print(round(int( "$(cat /sys/class/power_supply/BAT0/energy_now)" ) / int( "$(cat /sys/class/power_supply/BAT0/energy_full)" )*100))"
root #
emerge --ask sys-apps/lm-sensors
/root/gettemp.sh
#!/usr/bin/env bash
sensors -j 2>/dev/null | jq '."nvme-pci-0200"."Composite"."temp1_input"' | grep --color=never -o '[0-9]*\.'