linux-on-pixel-c icon indicating copy to clipboard operation
linux-on-pixel-c copied to clipboard

Graphics Acceleration Is Missing

Open denysvitali opened this issue 7 years ago β€’ 140 comments

Currently Linux on Pixel C is missing GPU Acceleration, therefore the UI is laggy dmesg is available here

[root@alarm /]# cat /var/log/Xorg.0.log
[   899.733] 
X.Org X Server 1.19.3
Release Date: 2017-03-15
[   899.733] X Protocol Version 11, Revision 0
[   899.733] Build Operating System: Linux 3.14.65-16-ARCH aarch64 
[   899.733] Current Operating System: Linux alarm 4.13.0-rc4+ #13 SMP PREEMPT Wed Aug 9 20:46:38 UTC 2017 aarch64
[   899.733] Kernel command line: cros_secure vpr=0x08000000@0xf6800000 earlycon
[   899.733] Build Date: 13 August 2017  04:10:10PM
[   899.733]  
[   899.733] Current version of pixman: 0.34.0
[   899.733]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[   899.733] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   899.733] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Aug 16 12:00:35 2017
[   899.734] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   899.734] (==) No Layout section.  Using the first Screen section.
[   899.734] (==) No screen section available. Using defaults.
[   899.734] (**) |-->Screen "Default Screen Section" (0)
[   899.734] (**) |   |-->Monitor "<default monitor>"
[   899.734] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[   899.734] (==) Automatically adding devices
[   899.734] (==) Automatically enabling devices
[   899.734] (==) Automatically adding GPU devices
[   899.734] (==) Automatically binding GPU devices
[   899.734] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   899.734] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[   899.734]    Entry deleted from font path.
[   899.734] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[   899.734]    Entry deleted from font path.
[   899.734]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
[   899.734] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[   899.734]    Entry deleted from font path.
[   899.734]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[   899.734] (==) FontPath set to:
        /usr/share/fonts/misc/,
        /usr/share/fonts/TTF/,
        /usr/share/fonts/OTF/
[   899.734] (==) ModulePath set to "/usr/lib/xorg/modules"
[   899.734] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[   899.734] (II) Loader magic: 0x1207d4d20
[   899.734] (II) Module ABI versions:
[   899.734]    X.Org ANSI C Emulation: 0.4
[   899.734]    X.Org Video Driver: 23.0
[   899.734]    X.Org XInput driver : 24.1
[   899.734]    X.Org Server Extension : 10.0
[   899.736] (++) using VT number 7

[   899.736] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[   899.737] (II) xfree86: Adding drm device (/dev/dri/card0)
[   899.742] (II) no primary bus or device found
[   899.742]    falling back to /sys/devices/platform/50000000.host1x/drm/drm/card0
[   899.742] (II) LoadModule: "glx"
[   899.742] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   899.751] (II) Module glx: vendor="X.Org Foundation"
[   899.751]    compiled for 1.19.3, module version = 1.0.0
[   899.751]    ABI class: X.Org Server Extension, version 10.0
[   899.751] (==) Matched modesetting as autoconfigured driver 0
[   899.751] (==) Matched fbdev as autoconfigured driver 1
[   899.751] (==) Assigned the driver to the xf86ConfigLayout
[   899.751] (II) LoadModule: "modesetting"
[   899.751] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   899.751] (II) Module modesetting: vendor="X.Org Foundation"
[   899.751]    compiled for 1.19.3, module version = 1.19.3
[   899.751]    Module class: X.Org Video Driver
[   899.751]    ABI class: X.Org Video Driver, version 23.0
[   899.752] (II) LoadModule: "fbdev"
[   899.752] (WW) Warning, couldn't open module fbdev
[   899.752] (II) UnloadModule: "fbdev"
[   899.752] (II) Unloading fbdev
[   899.752] (EE) Failed to load module "fbdev" (module does not exist, 0)
[   899.752] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   899.758] (II) modeset(0): using drv /dev/dri/card0
[   899.759] (II) modeset(0): Creating default Display subsection in Screen section
        "Default Screen Section" for depth/fbbpp 24/32
[   899.759] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[   899.759] (==) modeset(0): RGB weight 888
[   899.759] (==) modeset(0): Default visual is TrueColor
[   899.759] (II) Loading sub module "glamoregl"
[   899.759] (II) LoadModule: "glamoregl"
[   899.759] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[   899.761] (II) Module glamoregl: vendor="X.Org Foundation"
[   899.761]    compiled for 1.19.3, module version = 1.0.0
[   899.761]    ABI class: X.Org ANSI C Emulation, version 0.4
[   899.761] (II) glamor: OpenGL accelerated X.org driver based.
[   899.872] (II) glamor: EGL version 1.4 (DRI2):
[   899.872] EGL_MESA_drm_image required.
[   899.873] (EE) modeset(0): glamor initialization failed
[   899.873] (II) modeset(0): ShadowFB: preferred NO, enabled NO
[   899.873] (II) modeset(0): Output DSI-1 has no monitor section
[   899.873] (II) modeset(0): EDID for output DSI-1
[   899.873] (II) modeset(0): Printing probed modes for output DSI-1
[   899.873] (II) modeset(0): Modeline "2560x1800"x60.0  304.42  2560 2640 2720 2800  1800 1804 1808 1812 (108.7 kHz)
[   899.873] (II) modeset(0): Output DSI-1 connected
[   899.873] (II) modeset(0): Using sloppy heuristic for initial modes
[   899.873] (II) modeset(0): Output DSI-1 using initial mode 2560x1800 +0+0
[   899.873] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[   899.873] (==) modeset(0): DPI set to (96, 96)
[   899.873] (II) Loading sub module "fb"
[   899.873] (II) LoadModule: "fb"
[   899.874] (II) Loading /usr/lib/xorg/modules/libfb.so
[   899.874] (II) Module fb: vendor="X.Org Foundation"
[   899.874]    compiled for 1.19.3, module version = 1.0.0
[   899.874]    ABI class: X.Org ANSI C Emulation, version 0.4
[   899.874] (==) Depth 24 pixmap format is 32 bpp
[   899.897] (==) modeset(0): Backing store enabled
[   899.897] (==) modeset(0): Silken mouse enabled
[   899.897] (II) modeset(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[   899.897] (==) modeset(0): DPMS enabled
[   899.897] (--) RandR disabled
[   899.909] (II) AIGLX: Screen 0 is not DRI2 capable
[   899.909] (EE) AIGLX: reverting to software rendering
[   899.913] (II) IGLX: enabled GLX_MESA_copy_sub_buffer
[   899.915] (II) IGLX: Loaded and initialized swrast
[   899.915] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[   899.915] (II) modeset(0): Damage tracking initialized
[   899.915] (II) modeset(0): Setting screen physical size to 677 x 476
[   900.025] (II) config/udev: Adding input device hid-over-i2c 06CB:3370 (/dev/input/event0)
[   900.025] (**) hid-over-i2c 06CB:3370: Applying InputClass "libinput touchscreen catchall"
[   900.025] (II) LoadModule: "libinput"
[   900.026] (II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
[   900.029] (II) Module libinput: vendor="X.Org Foundation"
[   900.029]    compiled for 1.19.3, module version = 0.25.1
[   900.029]    Module class: X.Org XInput Driver
[   900.029]    ABI class: X.Org XInput driver, version 24.1
[   900.029] (II) Using input driver 'libinput' for 'hid-over-i2c 06CB:3370'
[   900.029] (**) hid-over-i2c 06CB:3370: always reports core events
[   900.029] (**) Option "Device" "/dev/input/event0"
[   900.029] (**) Option "_source" "server/udev"
[   900.030] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) is tagged by udev as: Touchscreen
[   900.031] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) device is a touch device
[   900.031] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) device removed
[   900.064] (**) Option "config_info" "udev:/sys/devices/platform/7000c000.i2c/i2c-0/0-0020/0018:06CB:3370.0001/input/input0/event0"
[   900.064] (II) XINPUT: Adding extended input device "hid-over-i2c 06CB:3370" (type: TOUCHSCREEN, id 6)
[   900.064] (**) Option "AccelerationScheme" "none"
[   900.064] (**) hid-over-i2c 06CB:3370: (accel) selected scheme none/0
[   900.064] (**) hid-over-i2c 06CB:3370: (accel) acceleration factor: 2.000
[   900.064] (**) hid-over-i2c 06CB:3370: (accel) acceleration threshold: 4
[   900.065] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) is tagged by udev as: Touchscreen
[   900.065] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) device is a touch device
[   900.066] (II) config/udev: Adding input device hid-over-i2c 06CB:3370 (/dev/input/mouse0)
[   900.066] (II) No input driver specified, ignoring this device.
[   900.066] (II) This device may have been added with another device file.
[   900.067] (II) config/udev: Adding input device gpio-keys (/dev/input/event1)
[   900.067] (**) gpio-keys: Applying InputClass "libinput keyboard catchall"
[   900.067] (II) Using input driver 'libinput' for 'gpio-keys'
[   900.067] (**) gpio-keys: always reports core events
[   900.067] (**) Option "Device" "/dev/input/event1"
[   900.067] (**) Option "_source" "server/udev"
[   900.068] (II) event1  - (II) gpio-keys: (II) is tagged by udev as: Keyboard Switch
[   900.068] (II) event1  - (II) gpio-keys: (II) device is a keyboard
[   900.068] (II) event1  - (II) gpio-keys: (II) device is a switch device
[   900.068] (II) event1  - (II) gpio-keys: (II) device removed
[   900.088] (**) Option "config_info" "udev:/sys/devices/platform/gpio-keys/input/input6/event1"
[   900.088] (II) XINPUT: Adding extended input device "gpio-keys" (type: KEYBOARD, id 7)
[   900.089] (II) event1  - (II) gpio-keys: (II) is tagged by udev as: Keyboard Switch
[   900.089] (II) event1  - (II) gpio-keys: (II) device is a keyboard
[   900.089] (II) event1  - (II) gpio-keys: (II) device is a switch device
[   900.884] (II) modeset(0): Disabling kernel dirty updates, not required.
[   914.720] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) device removed
[   914.756] (II) event1  - (II) gpio-keys: (II) device removed
[   915.900] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) is tagged by udev as: Touchscreen
[   915.900] (II) event0  - (II) hid-over-i2c 06CB:3370: (II) device is a touch device
[   915.901] (II) event1  - (II) gpio-keys: (II) is tagged by udev as: Keyboard Switch
[   915.901] (II) event1  - (II) gpio-keys: (II) device is a keyboard
[   915.901] (II) event1  - (II) gpio-keys: (II) device is a switch device

denysvitali avatar Aug 09 '17 13:08 denysvitali

[ 4.355693] nouveau 57000000.gpu: NVIDIA GM20B (12b000a1) [ 4.361115] nouveau 57000000.gpu: imem: using IOMMU [ 4.366069] nouveau 57000000.gpu: Direct firmware load for nvidia/gm20b/gr/gpccs_inst.bin failed with error -2 [ 4.376079] nouveau 57000000.gpu: gr: failed to load gr/gpccs_inst [ 4.382260] nouveau 57000000.gpu: gr ctor failed, -2
[ 4.387387] nouveau: probe of 57000000.gpu failed with error -2

The nouveau graphics driver is looking for, but not finding, the GPU firmware files. That particular binary blob has been released in a redistributable form by nvidia.

See:

  • (upstream) https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/nvidia/gm20b/gr
  • (Arch package) https://www.archlinux.org/packages/core/any/linux-firmware/

Depending upon your bootloader, those files will need to be put on your initramfs or whatever the Android bootloader looks for.

Echelon9 avatar Aug 14 '17 17:08 Echelon9

Thank you for your comment, I'll try to integrate the blob file in the kernel, or put it in the /lib folder.
I'll report back my findings

denysvitali avatar Aug 14 '17 18:08 denysvitali

Mmm, @Echelon9 that doesn't seem to be the problem. The file is available at /usr/lib/nvidia/gm20b/gr/gpccs_inst.bin (/lib is symlinked to /usr/lib), but apparently fails to load for some (to me unknown) reason

denysvitali avatar Aug 16 '17 16:08 denysvitali

You'll want the full path to resolve to /lib/firmware/nvidia/gm20b/gr/gpccs_inst.bin in order for the kernel module to find it.

So in your approach, /lib/firmware symlinked to /usr/lib.

Echelon9 avatar Aug 17 '17 02:08 Echelon9

@denysvitali any update from your further testing?

Echelon9 avatar Sep 21 '17 16:09 Echelon9

I'm trying to port the 4.14-rc1 kernel right now, afterwards I'll try with your suggestions. I'll report back soon! πŸ‘

denysvitali avatar Sep 21 '17 20:09 denysvitali

Here is the new 4.14-rc1 dmesg

/lib is symlinked to /usr/lib

[root@alarm alarm]# ls -l /lib
lrwxrwxrwx 1 root root 7 Sep 21 19:07 /lib -> usr/lib

gpccs_inst.bin exists in /usr/lib/firmware/nvidia/gm20b/gr

[root@alarm alarm]# ls -la /usr/lib/firmware/nvidia/gm20b/gr/
total 76
drwxr-xr-x 2 root root  4096 Sep 21 19:47 .
drwxr-xr-x 5 root root  4096 Sep 21 19:08 ..
-rw-r--r-- 1 root root   576 Sep 13 19:58 fecs_bl.bin
-rw-r--r-- 1 root root  1964 Sep 13 19:58 fecs_data.bin
-rw-r--r-- 1 root root 17021 Sep 13 19:58 fecs_inst.bin
-rw-r--r-- 1 root root    76 Sep 13 19:58 fecs_sig.bin
-rw-r--r-- 1 root root  2068 Sep 13 19:58 gpccs_data.bin
-rw-r--r-- 1 root root  9964 Sep 13 19:58 gpccs_inst.bin
-rw-r--r-- 1 root root  7616 Sep 13 19:58 sw_bundle_init.bin
-rw-r--r-- 1 root root  5448 Sep 13 19:58 sw_ctx.bin
lrwxrwxrwx 1 root root    33 Sep 13 19:58 sw_method_init.bin -> ../../gm200/gr/sw_method_init.bin
-rw-r--r-- 1 root root  1432 Sep 13 19:58 sw_nonctx.bin
[root@alarm alarm]# cat /sys/module/nouveau/parameters/modeset
-1

Some users on Arch Linux Forums suggest to set this kernel flag: nouveau.config=NvGrUseFW=1

I tried to add it, but the result is exactly the same. I also tried to add drm.atomic=1 firmware_class.path=/lib/firmware, but I get the same results: the binary doesn't get loaded

denysvitali avatar Sep 21 '17 21:09 denysvitali

May be helpful later: https://www.phoronix.com/scan.php?page=news_item&px=Tegra-2-Video-Decode-Driver-V3

denysvitali avatar Oct 12 '17 23:10 denysvitali

Probably not, that relates to the older Tegra 2 GPUs. This device has a Maxwell series GPU.

Echelon9 avatar Oct 13 '17 03:10 Echelon9

Yeah, realized after I posted. Brainfart :P

denysvitali avatar Oct 13 '17 22:10 denysvitali

Ideas

mirh avatar Oct 28 '17 13:10 mirh

Maybe @Gnurou can help us, somehow

denysvitali avatar Oct 29 '17 16:10 denysvitali

Mmm, everything seems to be in place, so I am not sure what happens here. I happen to own a Pixel C, so maybe I can try to reproduce and investigate. However I would like to avoid flashing it since I use it for work too. Has someone ever tried to boot off an external SD card and using just fastboot boot, instead of flashing?

I also think X may still require some extra patching to take advantage of HW acceleration, I can check that once the firmware issue is solved.

Gnurou avatar Oct 29 '17 23:10 Gnurou

@Gnurou The cleanest way to do it is to format the system partition (doesn't contain any personal data) and put the Arch Linux Arm files there (rootfs). I'll post my system.img here in a few minutes, so you can try it out.

For the kernel, you can try with my latest build (from lightbar-fix branch). This kernel boots from /system/, therefore your /data partition isn't touched at all.

Kernel

This build assumes you have the rootfs on /system (/dev/block/mmcblk0p4, limited to 3.7GB) lightbar-fix-fd6389ade197_20171029_232625.tar.gz

Boot w/ fastboot boot boot-lightbar-fix-fd6389ade197_20171029_232625.img.unsigned, keep in mind that flashing this without signing it won't work, therefore if you keep it unsigned you'll be able to boot it only via fastboot boot

Ramdisk

In case you want to boot from sdcard / whatever, you'll need to repack the kernel with the new ramdisk. Edit this to suit your needs , repack and you're good to go.

System

~~I will upload it here in a few minutes (refresh the page every 10 minutes if it isn't up yet)~~ There you are

Flash it w/ fastboot flash system system.img

Revert back to the original state

To return to a fully functional Pixel C, download the version you had on your Pixel C, extract the zip file, go to the extracted folder, unzip image-*..zip, fastboot flash system system.img, fastboot reboot. If that doesn't work, flash recovery (fastboot flash recovery recovery.img) too

denysvitali avatar Oct 30 '17 00:10 denysvitali

Thanks for the instructions, although I'd rather not mess with my work device at all :) I remember booting to a SD card rootfs on my old SHIELD device, let me see if I can reproduce that result on the Pixel C too since USB seems to work. I suppose that kind of setup could be useful to other users as well.

Or maybe I can put my hands on another device just for this issue. I will come back once I have results.

Gnurou avatar Oct 30 '17 05:10 Gnurou

You could try adding drm.debug=31 to cmdline for more debugging

opendata26 avatar Oct 31 '17 19:10 opendata26

@denysvitali also try building as a module

opendata26 avatar Oct 31 '17 21:10 opendata26

It indeed looks like the firmware files are not present on the initramfs, which would explain why the firmware loading function returns -ENOENT.

Building Nouveau as a module should definitely do the trick. An alternative would be to include the firmware files directly within the kernel image using CONFIG_EXTRA_FIRMWARE, but that's definitely not clean. I see no reason to not built Nouveau as a module since nobody should need it until the root FS is mounted anway.

Gnurou avatar Oct 31 '17 22:10 Gnurou

It works indeed. I've selected nouveau as a module, added drm.debug=31 (to add more debugging) insmoded the moduleit and tadΓ : Accleration is now available

It is still laggy with GNOME and videos are choppy, but it seems to be accelerated πŸ‘

Thank you!

denysvitali avatar Nov 01 '17 02:11 denysvitali

Oh wow, that's fantastic! Try setting the GPU clock to a higher speed, performance should increase:

echo b >/sys/class/drm/card1/device/pstate

... or something like that. cat pstate to see which values are acceptable.

Is this X? I would be surprised if it works out-of-the-box, last time I checked it (and Mesa) required a few external patches to connect the display and render nodes together. But maybe this has been taken care of in the meantime.

Gnurou avatar Nov 01 '17 02:11 Gnurou

@Gnurou Yes, it is X. Although GNOME runs on Wayland. Unfortunately I don't have any pstate in /sys/class/drm/card1/device.
Apparently the GM20b doesn't support clocking via nouveau

Little hope of reclocking becoming available for GM20x and newer GPUs as firmware now needs to be signed by NVIDIA to have the necessary access.

Here is the tree output of /sys/class/drm. I still can't figure it out why there are two cards, and why the screen looks like this on boot, instead of showing the kernel messages (and is not available until I restart lightdm a couple of times or wait a few minutes). In previous versions I was able to show the screen content by writing "1" and then "0" to /sys/class/graphics/fb0/blank. Reading on the NVIDIA forums this is used when some configuration changes (/sys/class/graphics/fb0/mode) are made. But since our implementation only supports a single mode, the only thing we can do is to blank the framebuffer, which unfortunately doesn't always help.

I can't figure out why after some minutes I get the green bars (#1) either.

Tree of /sys/class/drm:

/sys/class/drm/
|-- card0 -> ../../devices/platform/50000000.host1x/drm/drm/card0
|   |-- card0-DSI-1
|   |   |-- device -> ../../card0  [recursive, not followed]
|   |   |-- dpms
|   |   |-- edid
|   |   |-- enabled
|   |   |-- modes
|   |   |-- power
|   |   |-- status
|   |   |-- subsystem -> ../../../../../../../class/drm  [recursive, not followed]
|   |   `-- uevent
|   |-- dev
|   |-- device -> ../../../drm
|   |   |-- driver -> ../../../../bus/host1x/drivers/drm
|   |   |-- drm
|   |   |-- graphics
|   |   |-- of_node -> ../../../../firmware/devicetree/base/host1x@50000000
|   |   |-- power
|   |   |-- subsystem -> ../../../../bus/host1x
|   |   `-- uevent
|   |-- power
|   |   |-- autosuspend_delay_ms
|   |   |-- control
|   |   |-- runtime_active_time
|   |   |-- runtime_status
|   |   `-- runtime_suspended_time
|   |-- subsystem -> ../../../../../../class/drm  [recursive, not followed]
|   `-- uevent
|-- card0-DSI-1 -> ../../devices/platform/50000000.host1x/drm/drm/card0/card0-DSI-1  [recursive, not followed]
|-- card1 -> ../../devices/platform/57000000.gpu/drm/card1
|   |-- dev
|   |-- device -> ../../../57000000.gpu
|   |   |-- driver -> ../../../bus/platform/drivers/nouveau
|   |   |-- driver_override
|   |   |-- drm
|   |   |-- hwmon
|   |   |-- iommu -> ../70019000.memory-controller/iommu/70019000.memory-controller
|   |   |-- iommu_group -> ../../../kernel/iommu_groups/10
|   |   |-- modalias
|   |   |-- of_node -> ../../../firmware/devicetree/base/gpu@57000000
|   |   |-- power
|   |   |-- subsystem -> ../../../bus/platform
|   |   `-- uevent
|   |-- power
|   |   |-- autosuspend_delay_ms
|   |   |-- control
|   |   |-- runtime_active_time
|   |   |-- runtime_status
|   |   `-- runtime_suspended_time
|   |-- subsystem -> ../../../../../class/drm  [recursive, not followed]
|   `-- uevent
|-- renderD128 -> ../../devices/platform/50000000.host1x/drm/drm/renderD128
|   |-- dev
|   |-- device -> ../../../drm  [recursive, not followed]
|   |-- power
|   |   |-- autosuspend_delay_ms
|   |   |-- control
|   |   |-- runtime_active_time
|   |   |-- runtime_status
|   |   `-- runtime_suspended_time
|   |-- subsystem -> ../../../../../../class/drm  [recursive, not followed]
|   `-- uevent
|-- renderD129 -> ../../devices/platform/57000000.gpu/drm/renderD129
|   |-- dev
|   |-- device -> ../../../57000000.gpu  [recursive, not followed]
|   |-- power
|   |   |-- autosuspend_delay_ms
|   |   |-- control
|   |   |-- runtime_active_time
|   |   |-- runtime_status
|   |   `-- runtime_suspended_time
|   |-- subsystem -> ../../../../../class/drm  [recursive, not followed]
|   `-- uevent
|-- ttm -> ../../devices/virtual/drm/ttm
|   |-- buffer_objects
|   |   `-- bo_count
|   |-- memory_accounting
|   |   |-- dma_pool
|   |   |-- kernel
|   |   `-- pool
|   |-- power
|   |   |-- autosuspend_delay_ms
|   |   |-- control
|   |   |-- runtime_active_time
|   |   |-- runtime_status
|   |   `-- runtime_suspended_time
|   |-- subsystem -> ../../../../class/drm  [recursive, not followed]
|   `-- uevent
`-- version

43 directories, 46 files

The whole /sys/class/ folder

(Limited to 3 levels) Here

Modes available

[root@alarm ~]# cat /sys/class/graphics/fb0/modes 
U:2560x1800p-0

denysvitali avatar Nov 01 '17 12:11 denysvitali

Little hope of reclocking becoming available for GM20x and newer GPUs as firmware now needs to be signed by NVIDIA to have the necessary access.

That's a bit outdated. Moreover, X1 seems like the luckiest nvidia gpu since half a decade. EDIT: *fixed last link

mirh avatar Nov 01 '17 12:11 mirh

I tried the nouveau.NvFanless=true / nouveau.conifg=NvFanless=1 boot parameter, but apparently nouveau doesn't recognize it

[  790.904271] [TTM] Finalizing pool allocator
[  790.904461] [TTM] Finalizing DMA pool allocator
[  790.904521] [TTM] Zone  kernel: Used memory at exit: 0 kiB
[  793.820375] nouveau: unknown parameter 'NvFanless' ignored
[  793.821291] [drm:nouveau_drm_init [nouveau]] Loading Nouveau with parameters:
[  793.821732] [drm:nouveau_drm_init [nouveau]] ... tv_disable   : 0
[  793.822120] [drm:nouveau_drm_init [nouveau]] ... ignorelid    : 0
[  793.822470] [drm:nouveau_drm_init [nouveau]] ... duallink     : 1
[  793.822835] [drm:nouveau_drm_init [nouveau]] ... nofbaccel    : 0
[  793.823182] [drm:nouveau_drm_init [nouveau]] ... config       : NvGrUseFW=1
[  793.823551] [drm:nouveau_drm_init [nouveau]] ... debug        : (null)
[  793.823894] [drm:nouveau_drm_init [nouveau]] ... noaccel      : 0
[  793.824227] [drm:nouveau_drm_init [nouveau]] ... modeset      : -1
[  793.824553] [drm:nouveau_drm_init [nouveau]] ... runpm        : -1
[  793.824847] [drm:nouveau_drm_init [nouveau]] ... vram_pushbuf : 0
[  793.825138] [drm:nouveau_drm_init [nouveau]] ... hdmimhz      : 0
[  793.825860] nouveau 57000000.gpu: NVIDIA GM20B (12b000a1)
[  793.825896] nouveau 57000000.gpu: imem: using IOMMU
[  793.826233] [drm:drm_minor_register] 
[  793.826239] [drm:drm_minor_register] 
[  793.826401] [drm:drm_minor_register] new minor registered 129
[  793.826406] [drm:drm_minor_register] 
[  793.826507] [drm:drm_minor_register] new minor registered 1
[  793.840595] nouveau 57000000.gpu: DRM: not a PCI device; no HDMI
[  793.840827] [TTM] Zone  kernel: Available graphics memory: 1420528 kiB
[  793.840832] [TTM] Initializing pool allocator
[  793.840845] [TTM] Initializing DMA pool allocator
[  793.840872] nouveau 57000000.gpu: DRM: VRAM: 0 MiB
[  793.840877] nouveau 57000000.gpu: DRM: GART: 1048576 MiB
[  793.842907] nouveau 57000000.gpu: DRM: failed to create ce channel, -22
[  793.930577] nouveau 57000000.gpu: DRM: MM: using GRCE for buffer copies
[  793.930593] [drm] Initialized nouveau 1.3.1 20120801 for 57000000.gpu on minor 1
[  794.071684] [drm:vblank_disable_fn] disabling vblank on crtc 0

denysvitali avatar Nov 01 '17 13:11 denysvitali

Cause those patches haven't been pulled/mainlined yet.

mirh avatar Nov 01 '17 13:11 mirh

Sorry, my mistake. The pstate node has been moved to from sysfs to debugs. So you should be able to find it under /sys/kernel/debug or wherever debugfs is mounted.

Still I am not convinced that X is using acceleration at the moment. You may want to check by looking for mentions of glamor the in X logs, or running glxgears or some other GL-enabled application. My bet is that some patching is still needed.

Gnurou avatar Nov 01 '17 14:11 Gnurou

Found it: /sys/kernel/debug/dri/1 (which is the same as /sys/kernel/debug/dri/129)

[root@alarm 1]# cat pstate 
01: core 76 MHz *
02: core 153 MHz
03: core 230 MHz
04: core 307 MHz
05: core 384 MHz
06: core 460 MHz
07: core 537 MHz
08: core 614 MHz
09: core 691 MHz
0a: core 768 MHz
0b: core 844 MHz
0c: core 921 MHz
0d: core 998 MHz
DC: core 76 MHz

=>

[root@alarm 1]# echo "0c" > pstate
[root@alarm 1]# cat pstate 
01: core 76 MHz
02: core 153 MHz
03: core 230 MHz
04: core 307 MHz
05: core 384 MHz
06: core 460 MHz
07: core 537 MHz
08: core 614 MHz
09: core 691 MHz
0a: core 768 MHz
0b: core 844 MHz
0c: core 921 MHz AC DC *
0d: core 998 MHz
DC: core 921 MHz

[root@alarm 1]# cat /var/log/Xorg.0.log | grep glamor
[  2492.509] (II) Loading sub module "glamoregl"
[  2492.509] (II) LoadModule: "glamoregl"
[  2492.509] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[  2492.511] (II) Module glamoregl: vendor="X.Org Foundation"
[  2492.511] (II) glamor: OpenGL accelerated X.org driver based.
[  2492.643] (II) glamor: EGL version 1.4 (DRI2):
[  2492.644] (EE) modeset(0): glamor initialization failed
[  2492.647] (II) Loading sub module "glamoregl"
[  2492.647] (II) LoadModule: "glamoregl"
[  2492.647] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[  2492.647] (II) Module glamoregl: vendor="X.Org Foundation"
[  2492.647] (II) glamor: OpenGL accelerated X.org driver based.
[  2492.754] (II) glamor: EGL version 1.4 (DRI2):
[  2492.760] (II) modeset(G0): glamor initialized

2017-11-01-141659_2560x1800_scrot

Doesn't look good to me :(

denysvitali avatar Nov 01 '17 14:11 denysvitali

startx -- -logverbose 9 -verbose 9 try this, itll give some more x debug output

opendata26 avatar Nov 01 '17 15:11 opendata26

@opendata26 Here is the X log w/ verbosity set to 9 (I removed the lines after inputs, since they aren't releveant to our problem.

(II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
(II) Loader magic: 0xaaaae3277d28
(II) Module ABI versions:
        X.Org ANSI C Emulation: 0.4
        X.Org Video Driver: 23.0
        X.Org XInput driver : 24.1
        X.Org Server Extension : 10.0
(--) using VT number 1

(II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
(II) xfree86: Adding drm device (/dev/dri/card0)
(II) xfree86: Adding drm device (/dev/dri/card1)
(II) no primary bus or device found
        falling back to /sys/devices/platform/50000000.host1x/drm/drm/card0
(II) LoadModule: "glx"
(II) Loading /usr/lib/xorg/modules/extensions/libglx.so
(II) Module glx: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 1.0.0
        ABI class: X.Org Server Extension, version 10.0
(==) Matched modesetting as autoconfigured driver 0
(==) Matched fbdev as autoconfigured driver 1
(==) Assigned the driver to the xf86ConfigLayout
(II) LoadModule: "modesetting"
(II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
(II) Module modesetting: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 1.19.5
        Module class: X.Org Video Driver
        ABI class: X.Org Video Driver, version 23.0
(II) LoadModule: "fbdev"
(II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
(II) Module fbdev: vendor="X.Org Foundation"
        compiled for 1.19.3, module version = 0.4.4
        Module class: X.Org Video Driver
        ABI class: X.Org Video Driver, version 23.0
(II) modesetting: Driver for Modesetting Kernel Drivers: kms
(II) FBDEV: driver for framebuffer: fbdev
(II) modeset(0): using drv /dev/dri/card0
(WW) Falling back to old probe method for fbdev
(II) Loading sub module "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /usr/lib/xorg/modules/libfbdevhw.so
(II) Module fbdevhw: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 0.0.2
        ABI class: X.Org Video Driver, version 23.0
(II) modeset(G0): using drv /dev/dri/card1
(II) modeset(0): Creating default Display subsection in Screen section
        "Default Screen Section" for depth/fbbpp 24/32
(==) modeset(0): Depth 24, (==) framebuffer bpp 32
(==) modeset(0): RGB weight 888
(==) modeset(0): Default visual is TrueColor
(II) Loading sub module "glamoregl"
(II) LoadModule: "glamoregl"
(II) Loading /usr/lib/xorg/modules/libglamoregl.so
(II) Module glamoregl: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.4
(II) glamor: OpenGL accelerated X.org driver based.
failed to bind extensions
failed to load driver: tegra
(II) glamor: EGL version 1.4 (DRI2):
EGL_MESA_drm_image required.
(EE) modeset(0): glamor initialization failed
(II) modeset(0): ShadowFB: preferred NO, enabled NO
(II) modeset(0): Output DSI-1 has no monitor section
(II) modeset(0): Up to 1 crtcs needed for screen.
(II) modeset(0): Allocated crtc nr. 0 to this screen.
(II) modeset(0): Allocated crtc nr. 1 to this screen.
(II) modeset(0): EDID for output DSI-1
(II) modeset(0): Printing probed modes for output DSI-1
(II) modeset(0): Modeline "2560x1800"x60.0  304.42  2560 2640 2720 2800  1800 1804 1808 1812 (108.7 kHz)
(II) modeset(0): Output DSI-1 connected
(II) modeset(0): Using sloppy heuristic for initial modes
(II) modeset(0): Output DSI-1 using initial mode 2560x1800 +0+0
(==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
(==) modeset(0): DPI set to (96, 96)
(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Loading /usr/lib/xorg/modules/libfb.so
(II) Module fb: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.4
(==) modeset(G0): Depth 24, (==) framebuffer bpp 32
(==) modeset(G0): RGB weight 888
(==) modeset(G0): Default visual is TrueColor
(II) Loading sub module "glamoregl"
(II) LoadModule: "glamoregl"
(II) Loading /usr/lib/xorg/modules/libglamoregl.so
(II) Module glamoregl: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.4
(II) glamor: OpenGL accelerated X.org driver based.
(II) glamor: EGL version 1.4 (DRI2):
(II) modeset(G0): glamor initialized
(II) modeset(G0): Up to 0 crtcs needed for screen.
(==) modeset(G0): Using gamma correction (1.0, 1.0, 1.0)
(==) modeset(G0): DPI set to (96, 96)
(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Loading /usr/lib/xorg/modules/libfb.so
(II) Module fb: vendor="X.Org Foundation"
        compiled for 1.19.5, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.4
(II) UnloadModule: "fbdev"
(II) Unloading fbdev
(II) UnloadSubModule: "fbdevhw"
(II) Unloading fbdevhw
(==) Depth 24 pixmap format is 32 bpp
(==) modeset(G0): Backing store enabled
(==) modeset(G0): Silken mouse enabled
(II) modeset(G0): RandR 1.2 enabled, ignore the following RandR disabled message.
(==) modeset(G0): DPMS enabled
(II) modeset(G0): [DRI2] Setup complete
(II) modeset(G0): [DRI2]   DRI driver: nouveau
(II) modeset(G0): [DRI2]   VDPAU driver: nouveau
(==) modeset(0): Backing store enabled
(==) modeset(0): Silken mouse enabled
(II) modeset(0): RandR 1.2 enabled, ignore the following RandR disabled message.
(==) modeset(0): DPMS enabled
(--) RandR disabled
(II) AIGLX: Screen 0 is not DRI2 capable
(EE) AIGLX: reverting to software rendering
(II) IGLX: enabled GLX_MESA_copy_sub_buffer
(II) IGLX: Loaded and initialized swrast
(II) GLX: Initialized DRISWRAST GL provider for screen 0
(II) modeset(G0): Damage tracking initialized
(II) modeset(0): Damage tracking initialized
(II) modeset(0): Setting screen physical size to 677 x 476
(II) XKB: Reusing cached keymap
(II) config/udev: Adding input device hid-over-i2c 06CB:3370 (/dev/input/event0)
(**) hid-over-i2c 06CB:3370: Applying InputClass "libinput touchscreen catchall"
(II) LoadModule: "libinput"
(II) Loading /usr/lib/xorg/modules/input/libinput_drv.so
(II) Module libinput: vendor="X.Org Foundation"
        compiled for 1.19.3, module version = 0.26.0
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 24.1
(II) Using input driver 'libinput' for 'hid-over-i2c 06CB:3370'
        Option "_source" "server/udev"
        Option "name" "hid-over-i2c 06CB:3370"
        Option "path" "/dev/input/event0"
        Option "device" "/dev/input/event0"
        Option "major" "13"
        Option "minor" "64"
        Option "config_info" "udev:/sys/devices/platform/7000c000.i2c/i2c-0/0-0020/0018:06CB:3370.0001/input/input0/event0"
        Option "driver" "libinput"

This line caught my attention

(II) AIGLX: Screen 0 is not DRI2 capable
(EE) AIGLX: reverting to software rendering

Current boot args:

console=/dev/fb0,115200n8 consoleblank=0disp.screen0_output_mode=EDID:2560x1800p60 nouveau.config=NvGrUseFW=1,NvFanless=1 drm.debug=31 drm.atomic=1 firmware_class.path=/lib/firmware

I did symlink tegra_dri.so to nouveau_dri.so, JFYI

[root@alarm dvitali]# ls -la /usr/lib/xorg/modules/dri
total 64196
drwxr-xr-x 2 root root    4096 Nov  1 13:42 .
drwxr-xr-x 6 root root    4096 Oct 31 23:20 ..
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 kgsl_dri.so
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 kms_swrast_dri.so
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 msm_dri.so
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 nouveau_dri.so
-rwxr-xr-x 1 root root 4082128 Oct 29 15:14 nouveau_vieux_dri.so
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 swrast_dri.so
lrwxrwxrwx 1 root root      14 Nov  1 13:42 tegra_dri.so -> nouveau_dri.so
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 vc4_dri.so
-rwxr-xr-x 7 root root 8805160 Oct 29 15:14 virtio_gpu_dri.so

I also saw that there is an nvidia_drv.so in the Linux 4 Tegra drivers package. I have now tried to copy the necessary files in the correct places and I get the following, then the system hangs:

See the gist

It may also be due to the fact that all the NVIDIA libraries filled up my /system partition (which is only 3.8 GB), therefore I'm having some space problems too now 😞

denysvitali avatar Nov 01 '17 18:11 denysvitali

I think that's the stage where I need to look at my old Xorg an Mesa repositories. :) Let's see if I can get the system to boot and run on a device first, will probably take a few days before I can make an attempt.

Gnurou avatar Nov 01 '17 22:11 Gnurou

You could try disabling aglx?

opendata26 avatar Nov 02 '17 07:11 opendata26