johnfanv2 / LenovoLegionLinux

Driver and tools for controlling Lenovo Legion laptops in Linux including fan control and power mode.
https://github.com/johnfanv2/LenovoLegionLinux
GNU General Public License v2.0
1.52k stars 55 forks source link

[BUG] Trying to launch legion_gui with root #165

Closed MMorokk closed 6 months ago

MMorokk commented 7 months ago

Problem Description

Has the bug occurred following steps described in the README? What steps did you take? What commands did you enter? What was the (full) error you received and what command or action did lead to it? **Model and Debug Info** Distribution: Arch Linux x86_64 Model name: 82JU Legion 5 15ACH6H CPU model: AMD Ryzen 7 5800H with Radeon Graphics (16) @ 4.463GHz GPU model: NVIDIA GeForce RTX 3060 Mobile Keyboard backlight: single color with off/medium/bright Light in lid or logo: no Light at IO-Ports at back: no Output of `sudo dmidecode -t system`. Please remove Serial Number and UUID for privacy: ```text SMBIOS 3.3.0 present. Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: LENOVO Product Name: 82JU Version: Legion 5 15ACH6H Wake-up Type: Power Switch SKU Number: LENOVO_MT_82JU_BU_idea_FM_Legion 5 15ACH6H Family: Legion 5 15ACH6H Handle 0x0021, DMI type 12, 5 bytes System Configuration Options Option 1: String1 for Type12 Equipment Manufacturer Option 2: String2 for Type12 Equipment Manufacturer Option 3: String3 for Type12 Equipment Manufacturer Option 4: String4 for Type12 Equipment Manufacturer Handle 0x0031, DMI type 32, 20 bytes System Boot Information Status: No errors detected ``` Output of `sudo dmidecode -t bios`: ```text BIOS Information Vendor: LENOVO Version: GKCN54WW Release Date: 05/05/2022 Address: 0xE0000 Runtime Size: 128 kB ROM Size: 16 MB Characteristics: PCI is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported EDD is supported Japanese floppy for NEC 9800 1.2 MB is supported (int 13h) Japanese floppy for Toshiba 1.2 MB is supported (int 13h) 5.25"/360 kB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 kB floppy services are supported (int 13h) 3.5"/2.88 MB floppy services are supported (int 13h) 8042 keyboard services are supported (int 9h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported BIOS boot specification is supported Targeted content distribution is supported UEFI is supported BIOS Revision: 1.54 Firmware Revision: 1.54 ``` Output of `sudo cat /sys/kernel/debug/legion/fancurve`: ```text cat: /sys/kernel/debug/legion/fancurve: Немає такого файла або каталогу (this file or directory doesnt exist, just in ukrainian) ``` Can`t launch legion_gui with root: ```text $ sudo legion_gui Authorization required, but no authorization protocol specified qt.qpa.xcb: could not connect to display :0 qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb, wayland-egl, wayland. ``` UPD: And when i trying to use cli i get: ```text $ sudo legion_cli batteryconservation-enable Traceback (most recent call last): File "/usr/bin/legion_cli", line 8, in sys.exit(main()) ^^^^^^ File "/usr/lib/python3.11/site-packages/legion_linux/legion_cli.py", line 464, in main legion = LegionModelFacade(expect_hwmon=not args.donotexpecthwmon) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/legion_linux/legion.py", line 1375, in __init__ self.fancurve_io = FanCurveIO(expect_hwmon=expect_hwmon) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/legion_linux/legion.py", line 753, in __init__ raise Exception("hwmon dir not found") Exception: hwmon dir not found ```
JosuBarru commented 7 months ago

If using wayland, running xhost local:root worked for me

MrDuartePT commented 6 months ago

Not launch the gui with root, use the dektop file or use the command legion_gui --use_legion_cli_to_write

Opening app with root access is not allow on Wayland and also could be dangerous that why the polkit files exist.

MrDuartePT commented 6 months ago

Problem Description Has the bug occurred following steps described in the README? What steps did you take? What commands did you enter? What was the (full) error you received and what command or action did lead to it?

Model and Debug Info

Distribution: Arch Linux x86_64 Model name: 82JU Legion 5 15ACH6H CPU model: AMD Ryzen 7 5800H with Radeon Graphics (16) @ 4.463GHz GPU model: NVIDIA GeForce RTX 3060 Mobile Keyboard backlight: single color with off/medium/bright Light in lid or logo: no Light at IO-Ports at back: no

Output of sudo dmidecode -t system. Please remove Serial Number and UUID for privacy:

SMBIOS 3.3.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
  Manufacturer: LENOVO
  Product Name: 82JU
  Version: Legion 5 15ACH6H

  Wake-up Type: Power Switch
  SKU Number: LENOVO_MT_82JU_BU_idea_FM_Legion 5 15ACH6H
  Family: Legion 5 15ACH6H

Handle 0x0021, DMI type 12, 5 bytes
System Configuration Options
  Option 1: String1 for Type12 Equipment Manufacturer
  Option 2: String2 for Type12 Equipment Manufacturer
  Option 3: String3 for Type12 Equipment Manufacturer
  Option 4: String4 for Type12 Equipment Manufacturer

Handle 0x0031, DMI type 32, 20 bytes
System Boot Information
  Status: No errors detected

Output of sudo dmidecode -t bios:

BIOS Information
  Vendor: LENOVO
  Version: GKCN54WW
  Release Date: 05/05/2022
  Address: 0xE0000
  Runtime Size: 128 kB
  ROM Size: 16 MB
  Characteristics:
      PCI is supported
      BIOS is upgradeable
      BIOS shadowing is allowed
      Boot from CD is supported
      Selectable boot is supported
      EDD is supported
      Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
      Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
      5.25"/360 kB floppy services are supported (int 13h)
      5.25"/1.2 MB floppy services are supported (int 13h)
      3.5"/720 kB floppy services are supported (int 13h)
      3.5"/2.88 MB floppy services are supported (int 13h)
      8042 keyboard services are supported (int 9h)
      CGA/mono video services are supported (int 10h)
      ACPI is supported
      USB legacy is supported
      BIOS boot specification is supported
      Targeted content distribution is supported
      UEFI is supported
  BIOS Revision: 1.54
  Firmware Revision: 1.54

Output of sudo cat /sys/kernel/debug/legion/fancurve:

cat: /sys/kernel/debug/legion/fancurve: Немає такого файла або каталогу
(this file or directory doesnt exist, just in ukrainian)

Can`t launch legion_gui with root:

$ sudo legion_gui 
Authorization required, but no authorization protocol specified

qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb, wayland-egl, wayland.

UPD: And when i trying to use cli i get:

$ sudo legion_cli batteryconservation-enable
Traceback (most recent call last):
  File "/usr/bin/legion_cli", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/legion_linux/legion_cli.py", line 464, in main
    legion = LegionModelFacade(expect_hwmon=not args.donotexpecthwmon)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/legion_linux/legion.py", line 1375, in __init__
    self.fancurve_io = FanCurveIO(expect_hwmon=expect_hwmon)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/legion_linux/legion.py", line 753, in __init__
    raise Exception("hwmon dir not found")
Exception: hwmon dir not found

Also I don't know ukrainian, but it seems to me the module didn't load. If you possible post the output of the make file after run make forcereloadmodule