olevenets2
Posts: 11
Joined: Wed Dec 04, 2019 5:59 pm

Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Wed Jan 08, 2020 3:01 pm

Hi, I am using the latest Ubuntu 19.10.1 64bit which contains mesa 19.2 package. How can I activate the latest v3d video driver in my system to get graphic acceleration in 3d games and applications? I tried writing dtoverlay=vc4-fkms-v3d in my /boot/firmware/config.txt, but could not load the lxqt desktop. Black screen only :?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25440
Joined: Sat Jul 30, 2011 7:41 pm

Re: Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Wed Jan 08, 2020 4:13 pm

I doubt that has been tried before. Perhaps you might get better results with Gentoo64, or just stick with 32bit Raspbian where it all works.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

m][sko
Posts: 107
Joined: Fri Jul 20, 2012 6:37 am
Location: Slovakia

Re: Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Sat Jan 11, 2020 1:37 pm

official ubuntu kernel don't have v3d module
https://bugs.launchpad.net/ubuntu/+sour ... ug/1852035
https://bugs.launchpad.net/ubuntu/+sour ... ug/1850876
https://bugs.launchpad.net/ubuntu/+sour ... ug/1853789

but you can recompile kernel and enable all needed modules

if you are looking for latest mesa ppa
https://launchpad.net/~oibaf/+archive/u ... cs-drivers

but you will see lots of artefacts(https://github.com/raspberrypi/linux/issues/3319).
I did some testing with weston and mutter

olevenets2
Posts: 11
Joined: Wed Dec 04, 2019 5:59 pm

Re: Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Mon Jan 13, 2020 6:31 pm

I tried recompiling the latest kernel 5.3.0-1015-raspi2, but unfortunately I got the error in bcm2835-camera.c

Code: Select all

In file included from ./include/media/v4l2-subdev.h:15,
                 from ./include/media/v4l2-device.h:13,
                 from drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:20:
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c: In function ‘buffer_cb’:
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:355:35: error: ‘struct mmal_buffer’ has no member named ‘length’
  355 |    __func__, status, buf, mmal_buf->length, mmal_buf->mmal_flags,
      |                                   ^~
./include/media/v4l2-common.h:57:44: note: in definition of macro ‘v4l2_printk’
   57 |  printk(level "%s: " fmt, (dev)->name , ## arg)
      |                                            ^~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:353:2: note: in expansion of macro ‘v4l2_dbg’
  353 |  v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
      |  ^~~~~~~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:355:53: error: ‘struct mmal_buffer’ has no member named ‘mmal_flags’
  355 |    __func__, status, buf, mmal_buf->length, mmal_buf->mmal_flags,
      |                                                     ^~
./include/media/v4l2-common.h:57:44: note: in definition of macro ‘v4l2_printk’
   57 |  printk(level "%s: " fmt, (dev)->name , ## arg)
      |                                            ^~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:353:2: note: in expansion of macro ‘v4l2_dbg’
  353 |  v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
      |  ^~~~~~~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:356:12: error: ‘struct mmal_buffer’ has no member named ‘pts’
  356 |    mmal_buf->pts);
      |            ^~
./include/media/v4l2-common.h:57:44: note: in definition of macro ‘v4l2_printk’
   57 |  printk(level "%s: " fmt, (dev)->name , ## arg)
      |                                            ^~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:353:2: note: in expansion of macro ‘v4l2_dbg’
  353 |  v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
      |  ^~~~~~~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:367:14: error: ‘struct mmal_buffer’ has no member named ‘length’
  367 |  if (mmal_buf->length == 0) {
      |              ^~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:409:21: error: ‘struct mmal_buffer’ has no member named ‘pts’
  409 |  } else if (mmal_buf->pts != 0) {
      |                     ^~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:411:28: error: ‘struct mmal_buffer’ has no member named ‘pts’
  411 |   s64 runtime_us = mmal_buf->pts -
      |                            ^~
In file included from ./include/media/v4l2-subdev.h:15,
                 from ./include/media/v4l2-device.h:13,
                 from drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:20:
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:418:46: error: ‘struct mmal_buffer’ has no member named ‘pts’
  418 |     dev->capture.vc_start_timestamp, mmal_buf->pts,
      |                                              ^~
./include/media/v4l2-common.h:57:44: note: in definition of macro ‘v4l2_printk’
   57 |  printk(level "%s: " fmt, (dev)->name , ## arg)
      |                                            ^~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:415:3: note: in expansion of macro ‘v4l2_dbg’
  415 |   v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
      |   ^~~~~~~~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:447:53: error: ‘struct mmal_buffer’ has no member named ‘length’
  447 |  vb2_set_plane_payload(&buf->vb.vb2_buf, 0, mmal_buf->length);
      |                                                     ^~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:448:14: error: ‘struct mmal_buffer’ has no member named ‘mmal_flags’
  448 |  if (mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME)
      |              ^~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:456:14: error: ‘struct mmal_buffer’ has no member named ‘mmal_flags’
  456 |  if (mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS &&
      |              ^~
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c: In function ‘start_streaming’:
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:624:63: error: passing argument 3 of ‘vchiq_mmal_port_enable’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  624 |      vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb);
      |                                                               ^~~~~~~~~
      |                                                               |
      |                                                               void (*)(struct vchiq_mmal_instance *, struct vchiq_mmal_port *, int,  struct mmal_buffer *)
In file included from drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:31:
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h:127:24: note: expected ‘vchiq_mmal_buffer_cb’ {aka ‘void (*)(struct vchiq_mmal_instance *, struct vchiq_mmal_port *, int,  struct mmal_buffer *, long unsigned int,  unsigned int,  long long int,  long long int)’} but argument is of type ‘void (*)(struct vchiq_mmal_instance *, struct vchiq_mmal_port *, int,  struct mmal_buffer *)’
  127 |   vchiq_mmal_buffer_cb buffer_cb);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
cc1: some warnings being treated as errors
Do you know where I can find a patch for this?

olevenets2
Posts: 11
Joined: Wed Dec 04, 2019 5:59 pm

Re: Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Fri Jan 17, 2020 3:22 pm

I took the source code for bcm2835-camera.c and controls.c with the kernel 5.3.18 for the kernel to patch the source code of the standard Ubuntu kernel, after which its kernel was successfully configured with the V3D driver turned on. At first glance, everything is working fine
Attachments
screen.jpg
screen.jpg (143.3 KiB) Viewed 1233 times

gilius2k15
Posts: 67
Joined: Thu Jul 18, 2019 8:42 am

Re: Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Sat Jan 18, 2020 1:45 am

jamesh wrote:
Wed Jan 08, 2020 4:13 pm
I doubt that has been tried before. Perhaps you might get better results with Gentoo64, or just stick with 32bit Raspbian where it all works.
Well I'll be damned. Gentoo still remains ahead of all it's competitors from day 1. Canonical need to fix up...

User avatar
Gavinmc42
Posts: 4339
Joined: Wed Aug 28, 2013 3:31 am

Re: Ubuntu 19.10 64bit V3D OpenGL driver for Raspberry Pi 4

Sat Jan 18, 2020 10:14 am

I doubt that has been tried before. Perhaps you might get better results with Gentoo64, or just stick with 32bit Raspbian where it all works./
To boldly go where no one has gone before!
Except Sakaki ;)

It looks like Ubuntu is a few versions of Mesa behind Gentoo64.
I didn't like Ubuntu and now play with Debian64.
But I use Gentoo64 as my main OS.

Try everything, only time, skills and knowledge are your limits.
Some stuff is easy to get working, some is hard.
Most is unknown because no one has tried.

Distributions have become like computer languages, I use what works and spend time learning others.
The more OS's that run on Pi's the better.
Just don't expect too much help from RPF, they are busy. and limited in resources to support every OS.

Please post any successes, it is nice to know what works and doesn't yet.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Ubuntu”