NetBSD Problem Report #53042

From www@NetBSD.org  Tue Feb 20 12:50:35 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 260157A10E
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 20 Feb 2018 12:50:35 +0000 (UTC)
Message-Id: <20180220125031.161A87A21A@mollari.NetBSD.org>
Date: Tue, 20 Feb 2018 12:50:31 +0000 (UTC)
From: michael.blatt@gmail.com
Reply-To: michael.blatt@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Raspberry pi GPU programs fails with "* failed to add service - already in use?"
X-Send-Pr-Version: www-1.0

>Number:         53042
>Category:       port-arm
>Synopsis:       Raspberry pi GPU programs fails with "* failed to add service - already in use?"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-arm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 20 12:55:01 +0000 2018
>Closed-Date:    Mon Jan 21 19:52:54 +0000 2019
>Last-Modified:  Mon Jan 21 19:52:54 +0000 2019
>Originator:     Michael Blatt
>Release:        NetBSD 8.99.12 pkgsrc 2017_Q4
>Organization:
>Environment:
>Description:
I can't get any program to run that tries to use GPU acceleration on
my RPI 1b rev2 (earmv6hf).
Tried this with both a self-built image and Jun's latest image (so 8.99.12),

Even hello_triangle.bin under /usr/pkg/src (not /usr/pkgsrc), part of
raspberrypi-userland, returns this error when run:

 * failed to add service - already in use?

With Linux this error message has historically been caused by firmware
issues, or a suboptimal gpu_mem split. I've tried gpu_mem=32, 64, 128
and even 256, to no avail.
I've also swapped the firmware for older versions that I've been using
on my RPI2 with NetBSD (same version).
>How-To-Repeat:
1. download raspberrypi image 

http://cdn.netbsd.org/pub/NetBSD/misc/jun/raspberry-pi/2018-02-11-earmv6hf/2018-02-11-netbsd-raspi-earmv6hf.img.gz
http://mail-index.netbsd.org/port-arm/2018/02/06/msg004579.html

or the build server images (earmv6hf or earmv7hf)

2. copy to microsd

gunzip < 2018-02-11-netbsd-raspi-earmv6hf.img.gz |dd of=/dev/rsd0d bs=4m

3. setup Raspberry PI 0/1/2/3
- microsd card
- connect HDMI
- USB keyboard

4. extract pkgsrc 2017_Q4

5. build misc/raspberrypi-userland

6. build hello_triangle from /usr/pkg/src/hello_pi/ or any other example program that uses 3D acceleration. Note that this needs some paths adjusted and LD_LIBRARY_PATH specified when running.
This also applies to any package that uses 3D acceleration.
>Fix:
not known

>Release-Note:

>Audit-Trail:
From: Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-arm/53042 Raspberry pi GPU programs fails with "* failed to
 add service - already in use?"
Date: Sun, 19 Aug 2018 21:29:58 +0900

 This is perhaps the same problem as port-evbarm/52984:
 http://gnats.netbsd.org/52984

From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53042 CVS commit: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts
Date: Wed, 22 Aug 2018 13:16:41 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Wed Aug 22 13:16:41 UTC 2018

 Modified Files:
 	src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm283x.dtsi

 Log Message:
 Explicitly disable v3d, pixelvalve, and hvs for bcm283x at the moment.

 When these devices or hdmi are enabled, firmware turns off GPU functionality of
 VideoCore, expecting OS drivers handle it appropriately:

 https://github.com/raspberrypi/firmware/issues/763

 This breaks userland applications using /dev/vchiq, such as omxplayer.

 XXX We need enable them back when we import vc4 drm driver.

 Fix PR port-evbarm/52984 and
 PR port-arm/53042.

 OK jmcneill, skrll


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 \
     src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm283x.dtsi

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: rin@NetBSD.org
State-Changed-When: Wed, 22 Aug 2018 13:33:57 +0000
State-Changed-Why:
Now, hello_triangle works fine with new *.dtb files on my Raspberry Pi 3.

Could you please confirm fix?

Note that besides *.dtb, you need kernel newer than 2018-08-19 with this fix:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/evbarm/conf/files.evbarm#rev1.31

Otherwise, you cannot open /dev/vchiq.


From: Michael Blatt <michael.blatt@gmail.com>
To: gnats-bugs@gnats.netbsd.org
Cc: 
Subject: Re: port-arm/53042
Date: Mon, 21 Jan 2019 09:13:59 +0000

 --0000000000008e7738057ff44840
 Content-Type: text/plain; charset="UTF-8"

 Problem confirmed as resolved , many thanks!

 --0000000000008e7738057ff44840
 Content-Type: text/html; charset="UTF-8"

 <div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Problem confirmed as resolved , many thanks!</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div></div>

 --0000000000008e7738057ff44840--

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 21 Jan 2019 19:52:54 +0000
State-Changed-Why:
Confirmed fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.