CONFIG_DRM_V3D is disabled for linux-raspi2 of eoan

Bug #1850876 reported by Hui Wang on 2019-11-01
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux-raspi2 (Ubuntu)
Critical
Hui Wang
Eoan
Undecided
Unassigned

Bug Description

We enabled DRM_VC4 in the linux-raspi2 of eoan, but disabled the DRM_V3D.

In fact the DRM_V3D is crucial for graphical applications (such as ubuntu-desktop :) as it removes the graphical overhead from the cpu to the gpu, making the applications work much faster.

Please refer to https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1848703/comments/32

[Impact]
Users reported that we should enable the DRM_V3D, then the GPU will
be fully used when running "ubuntu-desktop"

[Fix]
Enable the DRM_V3D, the v3d.ko will be built

[Test Case]
Users already tested it, it worked well.
https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1848703/comments/36

[Regression Risk]
Low, I already did building test for arm64 and armhf, all passed.
And uers already tested the kernel module, it worked as expected.

CVE References

Hui Wang (hui.wang) on 2019-11-01
Changed in linux-raspi2 (Ubuntu):
assignee: nobody → Hui Wang (hui.wang)
importance: Undecided → Critical
Hui Wang (hui.wang) on 2019-11-01
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-raspi2 (Ubuntu):
status: New → Confirmed
Changed in linux-raspi2 (Ubuntu Eoan):
status: New → Fix Committed
Szakács Levente (szvl) wrote :

Does someone know when the fix will be ported to the Ubuntu arm64 image?

Mark Dunn (mdunn-home) wrote :

I tried upgrading from eoan-proposed, but it isn't there yet on the arm64 when is the next release please ?

Hui Wang (hui.wang) wrote :

So far, the latest kernel version is Ubuntu-raspi2-5.3.0-1012.14, it doesn't enable the V3D yet.

The next kernel version will include V3D driver module, maybe it will be named 5.3.0-1113. Anyway the kernel that is later than 1012 will include this driver.

Hui Wang (hui.wang) wrote :

We are going to release a new kernel soon, right now it is in the proposed channel, Welcome to test with the new kernel:

edit the $rpi_rootfs/etc/apt/sources.list and add:
deb http://ports.ubuntu.com/ubuntu-ports eoan-proposed main restricted
deb http://ports.ubuntu.com/ubuntu-ports eoan-proposed universe
deb http://ports.ubuntu.com/ubuntu-ports eoan-proposed multiverse

boot the rpi board, then run:
sudo apt-get update
sudo apt install linux-image-5.3.0-1013-raspi2
sudo reboot

Then you could do the test with the proposed kernel.

At least the 1013 kernel fixed these bugs compared with 1012 kernel:
https://bugs.launchpad.net/bugs/1850876
https://bugs.launchpad.net/bugs/1852510

Ian Pitt (idpitt) wrote :

Thanks for the new kernel. I booted it and noted that the right drivers were now being used ( Accelerated video and glxinfo showing it was using VC4 rather than the original llvmpipe. However:

1) On Mate, the Pi locked up within a few seconds of resizing windows
2) On Ubuntu, it took a few minutes but again the machine locked up after using applications.

Ahead of failures, areas of the screens were flashing/jittering. Once locked, only a reboot would gain control of the console.

4GB Pi 4, all 64bit kernels - rock solid without acceleration on the former kernel, rock solid WITH acceleration when using Gentoo.

I reverted to the older kernel and the machine is back to being stable, albeit with out the acceleration.

Hui Wang (hui.wang) wrote :

@Ian,

"rock solid WITH acceleration when using Gentoo", could you please tell me what is the kernel version for Gentoo? Or could you paste the output of 'uname -a' under Gentoo?

I tested the branch rpi-5.3.y of upstream kernel (https://github.com/raspberrypi/linux.git), the v3d driver is better now, but still has some problems. So I guess the Gentoo uses 4.19 kernel?

BTW, we have another bug to track this issue https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1852035, from the comment #14 and #15 of that bug, we could see even applying the latest patches of v3d, the driver still has some problems.

So we need to disable the driver v3d in the kernel until the branch rpi-5.3.y has the perfect fix for this driver.

Ian Pitt (idpitt) wrote :

Yes, the Gentoo image is running 4.19.67.

Thanks, I can wait for a more stable version.

Ian Pitt (idpitt) wrote :

@Hui, I tried the patched kernel you released and posted on https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1852035 . It works fine ( other than the dmesg logs that the other tester posted ) under KDE Plasma and LXQt. It seems that only Mate suffers the flickering and other rendering artifacts. All desktops have accelerated compositing now as expected.

Hui Wang (hui.wang) wrote :

Thanks for your testing, I will post the remaining issues to upstream and let us wait for the fixes for the remaining issues.

Mark Dunn (mdunn-home) wrote :
Download full text (3.5 KiB)

short version:

With raspberry pi 4:
your binaries applied (https://people.canonical.com/~hwang4/v3d-fix/)
The screen flickers then blanks
I installed an built the latest mesa
The screen flickers then blanks
Back to the raspberry pi kernel (4.19)
Which still works...

long version:

downloaded ubuntu-19.10-preinstalled-server-arm64+raspi3.img and restored it to sdcard

sudo apt update
sudo apt upgrade
sudo apt install ubuntu-desktop

wget https://people.canonical.com/~hwang4/v3d-fix/linux-buildinfo-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
wget https://people.canonical.com/~hwang4/v3d-fix/linux-headers-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
wget https://people.canonical.com/~hwang4/v3d-fix/linux-image-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
wget https://people.canonical.com/~hwang4/v3d-fix/linux-modules-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb

sudo dpkg -i linux-modules-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
sudo dpkg -i linux-image-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
sudo dpkg -i linux-buildinfo-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb

sudo dpkg -i linux-headers-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
 linux-headers-5.3.0-1013-raspi2 depends on linux-raspi2-headers-5.3.0-1013; however:
  Package linux-raspi2-headers-5.3.0-1013 is not installed.
sudo apt --fix-broken install
The following packages will be REMOVED:
  linux-headers-5.3.0-1013-raspi2

sudo reboot
sudo apt-get install mesa-utils

glxinfo -B

name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Broadcom (0x14e4)
    Device: V3D 4.2 (0xffffffff)
    Version: 19.2.1
    Accelerated: yes
    Video memory: 3791MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 19.2.1
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 19.2.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

glxgears

Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
348 frames in 5.0 seconds = 69.440 FPS
247 frames in 5.0 seconds = 49.358 FPS
301 frames in 5.0 seconds = 60.029 FPS
301 frames in 5.0 seconds = 60.019 FPS
300 frames in 5.0 seconds = 59.999 FPS
300 frames in 5.0 seconds = 59.992 FPS
256 frames in 5.0 seconds = 51.041 FPS
300 frames in 5.0 seconds = 59.989 FPS
301 frames in 5.0 seconds = 60.011 FPS
X connection to :0 broken (explicit kill or server shutdown).

Eventually screen starts to flicker then blanks...
built and installed latest mesa - no change

sudo nano /etc/apt/sources.list (commented in all sources)
sudo apt update
sudo apt-get build-dep mesa

mkdir git
cd git
sudo apt-get build-dep mesa
sudo apt-get install -y pkg-config bison flex

git clone https://gitlab.freedesktop.org/mesa/drm.git
cd drm
meson build --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu
ninja -C build
sudo...

Read more...

Download full text (4.2 KiB)

On 2019/11/29 下午11:15, Mark Dunn wrote:
> short version:
>
> With raspberry pi 4:
> your binaries applied (https://people.canonical.com/~hwang4/v3d-fix/)
> The screen flickers then blanks
> I installed an built the latest mesa
> The screen flickers then blanks
> Back to the raspberry pi kernel (4.19)
> Which still works...
>
> long version:
>
> downloaded ubuntu-19.10-preinstalled-server-arm64+raspi3.img and
> restored it to sdcard
>
> sudo apt update
> sudo apt upgrade
> sudo apt install ubuntu-desktop
>
> wget https://people.canonical.com/~hwang4/v3d-fix/linux-buildinfo-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
> wget https://people.canonical.com/~hwang4/v3d-fix/linux-headers-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
> wget https://people.canonical.com/~hwang4/v3d-fix/linux-image-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
> wget https://people.canonical.com/~hwang4/v3d-fix/linux-modules-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
>
> sudo dpkg -i linux-modules-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
> sudo dpkg -i linux-image-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
> sudo dpkg -i linux-buildinfo-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
>
> sudo dpkg -i linux-headers-5.3.0-1013-raspi2_5.3.0-1013.15+v3d_arm64.deb
> linux-headers-5.3.0-1013-raspi2 depends on linux-raspi2-headers-5.3.0-1013; however:
> Package linux-raspi2-headers-5.3.0-1013 is not installed.
> sudo apt --fix-broken install
> The following packages will be REMOVED:
> linux-headers-5.3.0-1013-raspi2
>
> sudo reboot
> sudo apt-get install mesa-utils
>
> glxinfo -B
>
> name of display: :0
> display: :0 screen: 0
> direct rendering: Yes
> Extended renderer info (GLX_MESA_query_renderer):
> Vendor: Broadcom (0x14e4)
> Device: V3D 4.2 (0xffffffff)
> Version: 19.2.1
> Accelerated: yes
> Video memory: 3791MB
> Unified memory: yes
> Preferred profile: compat (0x2)
> Max core profile version: 0.0
> Max compat profile version: 2.1
> Max GLES1 profile version: 1.1
> Max GLES[23] profile version: 3.0
> OpenGL vendor string: Broadcom
> OpenGL renderer string: V3D 4.2
> OpenGL version string: 2.1 Mesa 19.2.1
> OpenGL shading language version string: 1.20
>
> OpenGL ES profile version string: OpenGL ES 3.0 Mesa 19.2.1
> OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
>
> glxgears
>
> Running synchronized to the vertical refresh. The framerate should be
> approximately the same as the monitor refresh rate.
> 348 frames in 5.0 seconds = 69.440 FPS
> 247 frames in 5.0 seconds = 49.358 FPS
> 301 frames in 5.0 seconds = 60.029 FPS
> 301 frames in 5.0 seconds = 60.019 FPS
> 300 frames in 5.0 seconds = 59.999 FPS
> 300 frames in 5.0 seconds = 59.992 FPS
> 256 frames in 5.0 seconds = 51.041 FPS
> 300 frames in 5.0 seconds = 59.989 FPS
> 301 frames in 5.0 seconds = 60.011 FPS
> X connection to :0 broken (explicit kill or server shutdown).

Are your sure you booted the system with the v3d-fix kernel? I remember
with that kernel, the glxgears at least could run without crash or
system hang, of course the v3d-fix has some other problems.

So could you please run 'uname -a' to check t...

Read more...

Launchpad Janitor (janitor) wrote :
Download full text (34.4 KiB)

This bug was fixed in the package linux-raspi2 - 5.3.0-1014.16

---------------
linux-raspi2 (5.3.0-1014.16) eoan; urgency=medium

  * eoan/linux-raspi2: 5.3.0-1014.16 -proposed tracker (LP: #1854006)

  * Need to disable CONFIG_DRM_V3D in the raspi2 eoan kernel (LP: #1853789)
    - [config] raspi2: Revert "UBUNTU: [config] raspi2: CONFIG_DRM_V3D=m"

linux-raspi2 (5.3.0-1013.15) eoan; urgency=medium

  * eoan/linux-raspi2: 5.3.0-1013.15 -proposed tracker (LP: #1852220)

  * Eoan update: 5.3.9 upstream stable release (LP: #1851550)
    - raspi2: [Config] Remove CONFIG_GENERIC_COMPAT_VDSO and
      CONFIG_CROSS_COMPILE_COMPAT_VDSO

  * Eoan update: v5.3.8 upstream stable release (LP: #1850456)
    - raspi2: [Config] CAVIUM_TX2_ERRATUM_219=n

  * IO errors when writing large amounts of data to USB storage in eoan on
    RPI2/3 (armhf kernel) (LP: #1852510)
    - SAUCE: dwc_otg: checking the urb->transfer_buffer too early (#3332)

  * Incorrect raspi2 snapcraft.yaml file (LP: #1851469)
    - [Packaging] raspi2: Fix snapcraft.yaml

  * CONFIG_DRM_V3D is disabled for linux-raspi2 of eoan (LP: #1850876)
    - [config] raspi2: CONFIG_DRM_V3D=m

  [ Ubuntu: 5.3.0-24.26 ]

  * eoan/linux: 5.3.0-24.26 -proposed tracker (LP: #1852232)
  * Eoan update: 5.3.9 upstream stable release (LP: #1851550)
    - io_uring: fix up O_NONBLOCK handling for sockets
    - dm snapshot: introduce account_start_copy() and account_end_copy()
    - dm snapshot: rework COW throttling to fix deadlock
    - Btrfs: fix inode cache block reserve leak on failure to allocate data space
    - btrfs: qgroup: Always free PREALLOC META reserve in
      btrfs_delalloc_release_extents()
    - iio: adc: meson_saradc: Fix memory allocation order
    - iio: fix center temperature of bmc150-accel-core
    - libsubcmd: Make _FORTIFY_SOURCE defines dependent on the feature
    - perf tests: Avoid raising SEGV using an obvious NULL dereference
    - perf map: Fix overlapped map handling
    - perf script brstackinsn: Fix recovery from LBR/binary mismatch
    - perf jevents: Fix period for Intel fixed counters
    - perf tools: Propagate get_cpuid() error
    - perf annotate: Propagate perf_env__arch() error
    - perf annotate: Fix the signedness of failure returns
    - perf annotate: Propagate the symbol__annotate() error return
    - perf annotate: Fix arch specific ->init() failure errors
    - perf annotate: Return appropriate error code for allocation failures
    - perf annotate: Don't return -1 for error when doing BPF disassembly
    - staging: rtl8188eu: fix null dereference when kzalloc fails
    - RDMA/siw: Fix serialization issue in write_space()
    - RDMA/hfi1: Prevent memory leak in sdma_init
    - RDMA/iw_cxgb4: fix SRQ access from dump_qp()
    - RDMA/iwcm: Fix a lock inversion issue
    - HID: hyperv: Use in-place iterator API in the channel callback
    - kselftest: exclude failed TARGETS from runlist
    - selftests/kselftest/runner.sh: Add 45 second timeout per test
    - nfs: Fix nfsi->nrequests count error on nfs_inode_remove_request
    - arm64: cpufeature: Effectively expose FRINT capability to userspace
    - arm64: Fix incorrect irqflag restore for priority masking fo...

Changed in linux-raspi2 (Ubuntu Eoan):
status: Fix Committed → Fix Released
Mark Dunn (mdunn-home) wrote :

I think the original 1013 had flicker and tearing before the screen went blank
(the os was still functional - ssh worked).

With your image/modules/buildinfo i get:

uname -a
Linux ubuntu 5.3.0-1013-raspi2 #15+v3d SMP Sun Nov 24 13:41:44 CST 2019 aarch64 aarch64 aarch64 GNU/Linux

Enlarging the glxgears window: I see flicker between the glxgears window, the background and terminal window when they overlap instead of just seeing the top one.
It hasn't gone blank ... yet

With pi 4.19 kernel/modules (from https://github.com/raspberrypi/linux) there is no flicker and the screen has never gone blank.

Hui Wang (hui.wang) wrote :

@Mark Dunn,

Ok, got it, will look for fixes from 4.19 branch.

thx.

Launchpad Janitor (janitor) wrote :
Download full text (34.4 KiB)

This bug was fixed in the package linux-raspi2 - 5.3.0-1014.16

---------------
linux-raspi2 (5.3.0-1014.16) eoan; urgency=medium

  * eoan/linux-raspi2: 5.3.0-1014.16 -proposed tracker (LP: #1854006)

  * Need to disable CONFIG_DRM_V3D in the raspi2 eoan kernel (LP: #1853789)
    - [config] raspi2: Revert "UBUNTU: [config] raspi2: CONFIG_DRM_V3D=m"

linux-raspi2 (5.3.0-1013.15) eoan; urgency=medium

  * eoan/linux-raspi2: 5.3.0-1013.15 -proposed tracker (LP: #1852220)

  * Eoan update: 5.3.9 upstream stable release (LP: #1851550)
    - raspi2: [Config] Remove CONFIG_GENERIC_COMPAT_VDSO and
      CONFIG_CROSS_COMPILE_COMPAT_VDSO

  * Eoan update: v5.3.8 upstream stable release (LP: #1850456)
    - raspi2: [Config] CAVIUM_TX2_ERRATUM_219=n

  * IO errors when writing large amounts of data to USB storage in eoan on
    RPI2/3 (armhf kernel) (LP: #1852510)
    - SAUCE: dwc_otg: checking the urb->transfer_buffer too early (#3332)

  * Incorrect raspi2 snapcraft.yaml file (LP: #1851469)
    - [Packaging] raspi2: Fix snapcraft.yaml

  * CONFIG_DRM_V3D is disabled for linux-raspi2 of eoan (LP: #1850876)
    - [config] raspi2: CONFIG_DRM_V3D=m

  [ Ubuntu: 5.3.0-24.26 ]

  * eoan/linux: 5.3.0-24.26 -proposed tracker (LP: #1852232)
  * Eoan update: 5.3.9 upstream stable release (LP: #1851550)
    - io_uring: fix up O_NONBLOCK handling for sockets
    - dm snapshot: introduce account_start_copy() and account_end_copy()
    - dm snapshot: rework COW throttling to fix deadlock
    - Btrfs: fix inode cache block reserve leak on failure to allocate data space
    - btrfs: qgroup: Always free PREALLOC META reserve in
      btrfs_delalloc_release_extents()
    - iio: adc: meson_saradc: Fix memory allocation order
    - iio: fix center temperature of bmc150-accel-core
    - libsubcmd: Make _FORTIFY_SOURCE defines dependent on the feature
    - perf tests: Avoid raising SEGV using an obvious NULL dereference
    - perf map: Fix overlapped map handling
    - perf script brstackinsn: Fix recovery from LBR/binary mismatch
    - perf jevents: Fix period for Intel fixed counters
    - perf tools: Propagate get_cpuid() error
    - perf annotate: Propagate perf_env__arch() error
    - perf annotate: Fix the signedness of failure returns
    - perf annotate: Propagate the symbol__annotate() error return
    - perf annotate: Fix arch specific ->init() failure errors
    - perf annotate: Return appropriate error code for allocation failures
    - perf annotate: Don't return -1 for error when doing BPF disassembly
    - staging: rtl8188eu: fix null dereference when kzalloc fails
    - RDMA/siw: Fix serialization issue in write_space()
    - RDMA/hfi1: Prevent memory leak in sdma_init
    - RDMA/iw_cxgb4: fix SRQ access from dump_qp()
    - RDMA/iwcm: Fix a lock inversion issue
    - HID: hyperv: Use in-place iterator API in the channel callback
    - kselftest: exclude failed TARGETS from runlist
    - selftests/kselftest/runner.sh: Add 45 second timeout per test
    - nfs: Fix nfsi->nrequests count error on nfs_inode_remove_request
    - arm64: cpufeature: Effectively expose FRINT capability to userspace
    - arm64: Fix incorrect irqflag restore for priority masking fo...

Changed in linux-raspi2 (Ubuntu):
status: Confirmed → Fix Released
natrium42 (alexei-karpenko) wrote :

Fix is not released since it was reverted above. Any updates on this?

Hui Wang (hui.wang) on 2019-12-08
Changed in linux-raspi2 (Ubuntu Eoan):
status: Fix Released → Triaged
Hui Wang (hui.wang) wrote :

The 5.3.y branch doesn't have this fix yet, and looking for fix patches from branch 4.19.y is not easy. If possible, it is helpful if users could file V3D issues against 5.3.y (https://github.com/raspberrypi/linux/issues)

Thx.

natrium42 (alexei-karpenko) wrote :

You are right, compiling the 4.19.y kernel works and seems to be stable.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers