Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1224027rwb; Thu, 4 Aug 2022 20:30:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR48tI5LDcoEcxYem4G+JBmJqpm0Q79HrKZ8bV6iBemiPfE0SzKD+cNn3rkA1gZ+71R47Huq X-Received: by 2002:a05:6402:2741:b0:434:fe8a:1f96 with SMTP id z1-20020a056402274100b00434fe8a1f96mr4858115edd.331.1659670255446; Thu, 04 Aug 2022 20:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659670255; cv=none; d=google.com; s=arc-20160816; b=aBHB6V0hsRPSf9rvZxuDCf13zZ7ENsz13dNLZcL+I2LudoEcATaSU4lCnAVfzoSok/ IHdOqdPgVd6JvC1OlmENlTgurjvUa3mwp90N71FOampeMGAmRldGp3JYHhXofcBDxxNP obg9xaXGnGYTFsW+7IHk9Uc2+aLmvIp0QPnTgqhd7i76s9GGLyScXTdGp57ZAe9GIxBe imQ3+nra8TLSdfqZR4ZPWMHwSM2UNSxBZ0gs0Yf4vjXvZ7+76cm1b0PQenbDIpBhO53F 4sRAz5Gw6jRqTkRAJEKzonwPLkpPbew5pUfpfyVimQhUUyVhyGmgjuTv9qN3W20MlcYv DEYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NDZ1lu3viM2SwqOHDYJb/tKatraI7ROG+LscheDgb9c=; b=yrN8lN4eHEs85UZyIEt2UwvcxsyC4LhacFg5XUOptsRa2W7Tt5jzwkJAIlL59cn/sw Ek4H2EiTnItYEx4J5Z8C55q5Ocl6WTKIDGqOi2FyTbux6u5hi/wnE8dZKQV1TNzNog5W TwtSqW+PbhpwtOxajL23KleuEXbFsvd0NgFZO089TtXJ25VBHEHytoSGPWrylfGG+MtF xJmr6dL1gTCH1UMmJaEB1pWALtSs2zj0nfS43sfRXAvHB0wYW/ncBeZTyJrXWMiO/fkO 8PCXwBBZmXHR6H2plASgLsfelnVIrdW7qKE8tlZs+G+jEl6foNt3YF1+F3XEKbHIDH77 6zLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M7zLWHjL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg30-20020a170907971e00b0072ee3fe1786si2323770ejc.729.2022.08.04.20.30.30; Thu, 04 Aug 2022 20:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M7zLWHjL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239895AbiHEDDM (ORCPT + 99 others); Thu, 4 Aug 2022 23:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiHEDDK (ORCPT ); Thu, 4 Aug 2022 23:03:10 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823F471BFD for ; Thu, 4 Aug 2022 20:03:09 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id y13so2617400ejp.13 for ; Thu, 04 Aug 2022 20:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=NDZ1lu3viM2SwqOHDYJb/tKatraI7ROG+LscheDgb9c=; b=M7zLWHjLCMcwm799MpVBMLQqKeyui+ER66VmPGglXm4YaJp/R9nAqykmDkO97izFEy 4ZWrSrVydWvoEURPgvEh+G3NjdvdxObD4E8+toKQAoAmYBRBokxDhjjzZURmL8ezZgzC RiurgDK2gpOEuz771cohb82+etBQxfRjd/GN7V4Fn6nSQPawScYiD+U5e5v435AB+Ych WBmVZW+9qyWWg2PFKpDWjjz+hmmA+I/Hm6TxUszgmnrdwruuTI82SWL8aTacTO86y4dO nL0tjNMXMH/VoeP8N+h7bIcP3FjvavIFYMk981y3bVXQAVJ5nRp8Fg1f3MfN6dpvVaJw 2z0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=NDZ1lu3viM2SwqOHDYJb/tKatraI7ROG+LscheDgb9c=; b=QtEA6MGiVYZAghx9kTrcHxgyXODCmzkDAXEPYgm/ZS4Ok4gS1cMWilPXc99GtHKQr8 6wvx/7S8U2sy5vSewZ4soVI1bL7iYhxpiMU+GR8GXjuq7O6pmYOZCtIYhKbxVP7XpR8J xZwA+GmClmowfN8avSh0GtC3R1HZRuygilgeRD1ifIxkVdq7S/Bp0wXgH9IgmrXDfvS+ OJtgPfsOD3hU16/Fiyy9Id8e542TI1GPC1t7elx/eJkwKvQvgvbuPEGiBxddV89kUqVF qhWD7+k8CUgbatzp783ipsZGfxy06UYO1oBiW0TbUARk5d5tl343H2SHjtXOEN7qfCGE kGSQ== X-Gm-Message-State: ACgBeo2jkDppvJ1UQJd+bepDtv+t2o8EJNqoY/anLmH8RZBTCSl0Cj3P Z6bYuGYqHXFqKXP8+2UKxiHdCuUOJ9fwvlOUMxA= X-Received: by 2002:a17:907:6eac:b0:730:a07f:38bb with SMTP id sh44-20020a1709076eac00b00730a07f38bbmr3870114ejc.750.1659668587947; Thu, 04 Aug 2022 20:03:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Airlie Date: Fri, 5 Aug 2022 13:02:56 +1000 Message-ID: Subject: Re: New subsystem for acceleration devices To: Oded Gabbay Cc: dri-devel , Greg Kroah-Hartman , Yuji Ishikawa , Jiho Chu , Arnd Bergmann , "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Aug 2022 at 17:44, Oded Gabbay wrote: > > On Thu, Aug 4, 2022 at 2:54 AM Dave Airlie wrote: > > > > On Thu, 4 Aug 2022 at 06:21, Oded Gabbay wrote: > > > > > > On Wed, Aug 3, 2022 at 10:04 PM Dave Airlie wrote: > > > > > > > > On Sun, 31 Jul 2022 at 22:04, Oded Gabbay wrote: > > > > > > > > > > Hi, > > > > > Greg and I talked a couple of months ago about preparing a new accel > > > > > subsystem for compute/acceleration devices that are not GPUs and I > > > > > think your drivers that you are now trying to upstream fit it as well. > > > > > > > > We've had some submissions for not-GPUs to the drm subsystem recently. > > > > > > > > Intel GNA, Intel VPU, NVDLA, rpmsg AI processor unit. > > > > > > > > why is creating a new subsystem at this time necessary? > > > > > > > > Are we just creating a subsystem to avoid the open source userspace > > > > consumer rules? Or do we have some concrete reasoning behind it? > > > > > > > > Dave. > > > > > > Hi Dave. > > > The reason it happened now is because I saw two drivers, which are > > > doing h/w acceleration for AI, trying to be accepted to the misc > > > subsystem. > > > Add to that the fact I talked with Greg a couple of months ago about > > > doing a subsystem for any compute accelerators, which he was positive > > > about, I thought it is a good opportunity to finally do it. > > > > > > I also honestly think that I can contribute much to these drivers from > > > my experience with the habana driver (which is now deployed in mass at > > > AWS) and contribute code from the habana driver to a common framework > > > for AI drivers. > > > > Why not port the habana driver to drm now instead? I don't get why it > > wouldn't make sense? > > imho, no, I don't see the upside. This is not a trivial change, and > will require a large effort. What will it give me that I need and I > don't have now ? The opportunity for review, code sharing, experience of locking hierarchy, mm integration? IMHO The biggest thing that drm has is the community of people who understand accelerators, memory management, userspace command submissions, fencing, dma-buf etc. It's hard to have input to those discussions from the outside, and they are always ongoing. I think one of the Intel teams reported dropping a lot of code on their drm port due to stuff already being there, I'd expect the same for you. The opposite question is also valid, what does moving to a new subsystem help you or others, when there is one with all the infrastructure and more importantly reviewers. I'd be happy to have accelerator submaintainers, I'd be happy to even create an ACCELERATOR property for non-gpu drivers, so they can opt out of some of the GPUier stuff, like multiple device node users etc, or even create a new class of device nodes under /dev/dri. > I totally agree. We need to set some rules and make sure everyone in > the kernel community is familiar with them, because now you get > different answers based on who you consult with. > > My rules of thumb that I thought of was that if you don't have any > display (you don't need to support X/wayland) and you don't need to > support opengl/vulkan/opencl/directx or any other gpu-related software > stack, then you don't have to go through drm. > In other words, if you don't have gpu-specific h/w and/or you don't > need gpu uAPI, you don't belong in drm. What happens when NVIDIA submit a driver for just compute or intel? for what is actually a GPU? This has been suggested as workaround for our userspace rules a few times. If my GPU can do compute tasks, do I have to add an accelerator subsystem driver alongside my GPU one? > After all, memory management services, or common device chars handling > I can get from other subsystems (e.g. rdma) as well. I'm sure I could > model my uAPI to be rdma uAPI compliant (I can define proprietary uAPI > there as well), but this doesn't mean I belong there, right ? Good point, but I think accelerators do mostly belong in drm or media, because there is enough framework around them to allow them to work, without reinventing everything. > > > > I think the one area I can see a divide where a new subsystem is for > > accelerators that are single-user, one shot type things like media > > drivers (though maybe they could be just media drivers). > > > > I think anything that does command offloading to firmware or queues > > belongs in drm, because that is pretty much what the framework does. I > I think this is a very broad statement which doesn't reflect reality > in the kernel. I think the habanalabs driver is one of the only ones that is outside this really, and in major use. There might be one or two other minor drivers with no real users. Dave.