Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics Acceleration Is Missing #2

Open
denysvitali opened this issue Aug 9, 2017 · 140 comments
Open

Graphics Acceleration Is Missing #2

denysvitali opened this issue Aug 9, 2017 · 140 comments
Labels
enhancement help wanted kind: kernel Kernel Related Issues priority: high High priority issues

Comments

@denysvitali
Copy link
Owner

denysvitali commented Aug 9, 2017

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 denysvitali changed the title Graphics Acceleration Graphics Acceleration Is Missing Aug 9, 2017
@Echelon9
Copy link

[ 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:

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

@denysvitali
Copy link
Owner Author

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
Copy link
Owner Author

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

@Echelon9
Copy link

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
Copy link

@denysvitali any update from your further testing?

@denysvitali
Copy link
Owner Author

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
Copy link
Owner Author

denysvitali commented Sep 21, 2017

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
Copy link
Owner Author

@Echelon9
Copy link

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

@denysvitali
Copy link
Owner Author

Yeah, realized after I posted. Brainfart :P

@mirh
Copy link

mirh commented Oct 28, 2017

Ideas

@denysvitali
Copy link
Owner Author

Maybe @Gnurou can help us, somehow

@Gnurou
Copy link

Gnurou commented Oct 29, 2017

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.

@denysvitali
Copy link
Owner Author

denysvitali commented Oct 30, 2017

@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

@Gnurou
Copy link

Gnurou commented Oct 30, 2017

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.

@opendata26
Copy link

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

@opendata26
Copy link

@denysvitali also try building as a module

@Gnurou
Copy link

Gnurou commented Oct 31, 2017

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.

@denysvitali
Copy link
Owner Author

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!

@Gnurou
Copy link

Gnurou commented Nov 1, 2017

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.

@denysvitali
Copy link
Owner Author

denysvitali commented Nov 1, 2017

@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

@mirh
Copy link

mirh commented Nov 1, 2017

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

@denysvitali
Copy link
Owner Author

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

@mirh
Copy link

mirh commented Nov 1, 2017

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

@Gnurou
Copy link

Gnurou commented Nov 1, 2017

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.

@denysvitali
Copy link
Owner Author

@vartom Good! We can try to makepkg during the rootfs build, and install it afterwards

@vartom
Copy link

vartom commented Mar 23, 2018

Yesterday I did not manage to make the package.
Perhaps we will wait for the release, if it includes support for tegra
https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/opengl-vulkan-mesa-gallium3d/1014386-mesa-18-0-rc5-released-mesa-18-0-should-finally-be-out-on-friday

@denysvitali
Copy link
Owner Author

Unfortunately mesa-18 hasn't been tagged... yet. Let's wait for a release and see if it works.

@vartom
Copy link

vartom commented Mar 24, 2018

@denysvitali this is not so important, in 18.0 there is still no support for tegra.
I still can not assemble the installation package. All the time that something goes wrong.
@denysvitali @Samt43 Can you try?

@vartom
Copy link

vartom commented Mar 25, 2018

I can not find a solution to several errors.
/usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory
Another such error
chmod: cannot access '/mnt/data/home/dima/Pc/rootfs/tegra-nouveau/out/target/aarch64/ArchLinuxArm/home/alarm/abs/mesa-full-tegra/pkg': No such file or directory
==> ERROR: A failure occurred in ().
I create a pkg directory, during the execution of makepkg it is deleted and again gives an error that there is no this directory

PKGBUILD.txt

@rakhenmanoa
Copy link

Hi guys, i just wanted to know if one can use the tegra X1 linux driver https://developer.nvidia.com/embedded/dlc/l4t-jetson-tx1-driver-package-28-2-ga on pixel C. Thank you.

@vartom
Copy link

vartom commented Apr 10, 2018

@rakhenmanoa As far as I know this driver can be used only with the appropriate kernel 28.2 (the driver in the kernel) for L4T from nvidia.

@sharukins
Copy link

Does the recently tagged mesa 18.1 RC support tegra?

@q66
Copy link

q66 commented Apr 23, 2018

@denysvitali
Copy link
Owner Author

I'll try a new build tomorrow and report back the results 👍

@rakhenmanoa
Copy link

Hi guys, the group fail0verflow posted a Linux system for the Nintendo switch with accelerated graphics, there https://fail0verflow.com/blog/2018/shofel2/ Do you think it will work on Pixel C ?

@denysvitali
Copy link
Owner Author

Hey @rakhenmanoa! I noticed it too and I'm currently setting up the CI to generate a rootfs w/ the latest mesa, as suggested by @q66.

I'll report back soon: meanwhile you can check the build status here

@q66
Copy link

q66 commented Apr 25, 2018

@denysvitali btw, once the GPU stuff is confirmed working and Mesa 18.1 makes it into its package repository, I'll probably look into porting Void Linux arm64 onto my Pixel C (it frequently lies unused unless I'm traveling, I'd like to change that) - what's the current status of Bluetooth support? Still the same with latest 4.17-rc2 kernel as previously, i.e. not working? Additionally, is there any public discussion channel? (ideally on IRC)

@denysvitali
Copy link
Owner Author

@q66
Wonderful! I look forward to your contribution!
I created the Linux On Pixel C Organization on GitHub and I plan to switch to it in the newr future, because this project isn't only mine.
If you want to be part of the organization I can add you as a member.

The current bluetooth support is being tracked in #10. At the moment the brcm4354 works just for the Wi-Fi (= Standard Bluetooth and BTLE doesn't work).

I haven't tried the latest 4.17-rc2 kernel, but I'm planning to. Theoretically speaking a kernel build is already ready (but not yet tested) here (and yes, that release name is ugly. I need to fix my CI)

There is currently no public discussion channel, but I've just created a Telegram group which can be found here
We can create an IRC channel on freenode and link the two. If you want to create it and moderate it you can do it :)

In the following hours I'll test the new kernel, and try to fix my CI. I'll then generate a better rootfs w/ the newest mesa 18.1

Hopefully I'll find some time to migrate / imolement the CI on the pixelc-linux organization.
Curently I'm using both Travis-CI and Jenkins (hosted at jenkins.ded1.denv.it). pixelc-linux members have the permissions to edit and run jobs on that istance as they wish

@q66
Copy link

q66 commented Apr 25, 2018

Alright. I created a #linux-on-pixel-c channel on freenode; if you want to get a relay bot in there or something, go ahead. I'll register the channel with chanserv in the meantime. And I guess it's a good idea to start looking into TWRP'ing my Pixel C and setting up Android tools (adb/fastboot) on my FreeBSD workstation and perhaps a Linux VM for building.

@thierryreding
Copy link

Everyone is welcome to join the #tegra channel on Freenode. Its focus is on upstream Linux development and most people involved with upstream Linux development on Tegra hang out there, so I it should be a good fit for what you're trying to achieve.

@denysvitali
Copy link
Owner Author

Btw, we now have a Telegram group which is linked to the #linux-on-pixel-c channel on Freenode. We'll discuss there about the project. Every progress we make will be published / described in the respective issue (on this project).

We'll eventually migrate to @pixelc-linux in the near future, in the meantime we'll keep the discussions here, on Telegram and on Freenode.

@thierryreding Thanks! I'll make sure to check out the #tegra channel!

@vartom
Copy link

vartom commented Apr 29, 2018

The kernel 4.17-rc2 does not correctly display the image on the screen.
Just like the kernel of Next-20180316, which I mentioned earlier.

@denysvitali
Copy link
Owner Author

@vartom What do you mean by "does not correctly display the image on the screen"? Are there glitches?
I personally tried w/ one of the recently tagged builds (for example this one) which use the Google provided tegra blobs, and it seems to work fine. Acceleration is still missing though because I wasn't able to build mesa 18.1 yet (I'm still having some problems w/ my Jenkins pipeline - I'll have to fix them when I have more free time)

@vartom
Copy link

vartom commented Apr 30, 2018

the logs are displayed correctly. The problem manifests itself when the image forms a GPU. turn on the utility kmscube or take my rootfs with working acceleration.

@vartom
Copy link

vartom commented Apr 30, 2018

@denysvitali I do not understand your persistence in using Google blobs. They will not work with the mainline kernel. Using them you will not get hardware video acceleration!

ps Conducted an elementary comparison of files by content. In the directory nvidia / tegra210 all files that are used by the mainline kernel (from Linux-firmware) are the same as those from Google.
The files in the firmware / new file directory are the same as the files located in the firmware / nvidia / gm20b / gr / directory, but they have different names.

Perhaps the mainline kernel can use old blob names, or maybe not.

@denysvitali
Copy link
Owner Author

@thierryreding

This is the email that @vartom has wrote you today. I pasted it here with his permission in order to keep the discussion public, so that everyone can help / be helped.

Hello.
I have already noted in the subject Graphics Acceleration Is Missing #2 that since the kernel is next from 03/16/18 the image has become spoiled on the screen. So I dropped some videos with a problem in the telegram group https://t.me/joinchat/AMCvfg2mCMNEQHJxvFzf2Q
Today I found out for what patch this happens.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/drivers/gpu/drm/tegra?id=4ae4b5c0dbaa499f2fd9215caac6e474c8dd477f
I tested it in the kernel and in the kernel 4.17. Without this patch, the image remains normal.
Could you double-check this patch and fix it?


cc/ @vartom, @q66, @NVIDIA

@denysvitali
Copy link
Owner Author

This is what happens:
img_20180504_123827

@PixelCUser
Copy link

Hello denysvitli,
Can you please put a package together for me that allows me to flash linux with gpu acceleration to my pixel c, in this forum post ive seen you get gpu acceleration to work so congrats on that,
i would like to test your linux build for the pixel c, im not a linux developer or someone who can port linux to android like you 😄 but i just want to try linux on my tablet<
Thanks :P

@q66
Copy link

q66 commented May 7, 2018

You will have to wait until our infra is properly up, I guess. Which hopefully shouldn't take long at this point...

@PixelCUser
Copy link

Ok cool, im currently actually installing the available build of linux for the pixel c but i ran in to a problem, the cache partition isn't big enough to store the latest rootfs tar

@denysvitali
Copy link
Owner Author

denysvitali commented May 7, 2018

@PixelCUser Just copy the rootfs over /sdcard

Btw, please, let's not go off topic here. If you're having some troubles installing a Linux Distro on your Pixel C, feel free to open a new issue. This is specifically related to the graphic acceleration issues we're facing.

In a couple of days we'll probably have a better way to deliver updated versions of our rootfs and kernel images, so that it will be easier for everyone to install a Linux Distro on their Pixel C.
If you want to be informed about the changes, click "Watch" on this repo to be notified of all the changes, or join our Telegram group at https://telegram.me/pixelclinux / IRC channel on Freenode #linux-on-pixel-c

Edit: Fix Telegram Link, thanks @mirh

tardyp added a commit to tardyp/switch-linux that referenced this issue May 9, 2018
q66 pushed a commit to pixelc-linux/linux that referenced this issue May 25, 2018
q66 pushed a commit to pixelc-linux/linux that referenced this issue May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted kind: kernel Kernel Related Issues priority: high High priority issues
Projects
None yet
Development

No branches or pull requests