Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3486499rwb; Sun, 7 Aug 2022 00:03:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ENusrWOVStFLqQI4Z9gvI4ca973r1Ggt2rr4kxjwsoUBIw0Oi/UDLx8I6/7cXA7LGXnbL X-Received: by 2002:a63:43c2:0:b0:41a:9dea:5dac with SMTP id q185-20020a6343c2000000b0041a9dea5dacmr11296753pga.585.1659855835609; Sun, 07 Aug 2022 00:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659855835; cv=none; d=google.com; s=arc-20160816; b=RLx1X39Z1SLj9AG1nxK08drgY7vkVh+LqHrEXaBWzQ0aXdHzQI2dtyfDa1DDbaLGBm oYDZwxVEorbkPYBAPSV2NYm0v20NMmb/aAKG7g0Fcwijxg8UEKgJs7UYgazrOwPGr5Kw H5CWDvniv+cxyIJr08SaIonXNWTxV0YUy0UXymN92RqEcC9T0PG8y0854eS5fm9vFDOv daKXhWn0+IzcZDHmsawMY98vPI5XlpGB1fXhebO5eMEtM2ljBTanzmy07z4cPtpjBFgo QnVCSr5EEnGWmUmRrwr6oCtTEqPq0EJ63qTmWbLLaCOeA/xKcANUH6k+F0GaDJkaFxjD A9cQ== 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=EiRzVeypDLqjukzgf6iPX2b/MdoDSPrXUwydmAaPBNI=; b=xy3Wa91ERiS/auOHGVFs4GjQFJWSRiRqBVHwemigCFnL7jXk3JBrmA5p02jNzgeVXw qN8sQig736HACMyj2V8OKhrIDcua2OXH/U8s5fva8xjY6CzfMYaJa1WJNTPp44E1OBeA GWR6x22iEVzJPEltRBB4+dMkqm2EkBp/52h7WTpRkjSey86y0AC4zH6oYOLFaIXgDb6X dNcNXjbh1eYa2iM8LZYs9vGQHRDtkIvb3rVyNnc3MOMdoGo6QGQrVG6Az4uuQ9vc6+Pg 1hMLt/+ZJXbdHKR5nNT1UQdUgzhYNtjhn/+LTjvZ1vVQm1+ct+7ppD75GtbPv61M3d6T fLrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ED7K+Khv; 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 oj5-20020a17090b4d8500b001f3395b7483si4462429pjb.183.2022.08.07.00.03.32; Sun, 07 Aug 2022 00:03: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=ED7K+Khv; 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 S232620AbiHGGvF (ORCPT + 99 others); Sun, 7 Aug 2022 02:51:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbiHGGvE (ORCPT ); Sun, 7 Aug 2022 02:51:04 -0400 Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94F342AC9 for ; Sat, 6 Aug 2022 23:51:03 -0700 (PDT) Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-10ec41637b3so7346084fac.4 for ; Sat, 06 Aug 2022 23:51:03 -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=EiRzVeypDLqjukzgf6iPX2b/MdoDSPrXUwydmAaPBNI=; b=ED7K+KhvdVGJGvdJ09bzRo9yLCld9L+T4nMDpRcNd7ScBb58Y9UoYatqTwKvNQ2btA PaLYb8pzG+mwHK9942wS3iISv1F82RL65+F+T33tSTqGy8lVx17AhR5sEIh2zk5Q7Wp+ ox1SAA52oF5D/XUUndg+boIZBYv7SS/eerpEFzkHqKwP6WA4FkxlTWqIqnbd1s/u59YB Uz5B0/36kmYvehCzL+zmBHAlx7IB6xVXlhypqlG5u5zx/7Hcj0XezL+Aa2xxzTt+ZU7K pCS2cXNvSAk3/c+iNpb4HbvyKNbGnUGHBrxNorfo1wxSzEDQ8zahq9LMlUNu58Cl6yfJ dvRg== 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=EiRzVeypDLqjukzgf6iPX2b/MdoDSPrXUwydmAaPBNI=; b=bqZfOiJElvjF+2sqI38lTriXMAVUv7G58GsmMJk9f1bD+W0bIPn4Ma/CtqJY2OdA9H rW/plYkuHzK7Sv2TvK2EmrwKqFyl/KC00KMS+cUXJICqHs1Hni4yX53k0UCoKnQ3yapn xoXOv6mAw0BYCo2B821NaBO0LmYlX90iOQH7o25kpn2IbuuEExYsy5kSi7adgBXrN4kj Mr3jfSoXQ4s+/BCWsS34pvQqaPEYEXJzUdJNRVF7Ny2wZz4ZqkDeIPRg1vw1pFM1dR5F 2UQCvo8LgaXUsakvGdYX4U4H8VV+5ZXXr1hjvWkMscVY9wvc21jrnh0HohgWZHePc/qG 5NOQ== X-Gm-Message-State: ACgBeo0yFY2lxBL2PtDh9d1PlECtTAIQp1aHm8/nq3LSn+UtVx3D8Qvb I+zIJj00T3fhPUmxk5Dlhk/g/Rzc7f0y82Cdo+k= X-Received: by 2002:a05:6870:961d:b0:10d:7606:b212 with SMTP id d29-20020a056870961d00b0010d7606b212mr5973437oaq.166.1659855062791; Sat, 06 Aug 2022 23:51:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Oded Gabbay Date: Sun, 7 Aug 2022 09:50:35 +0300 Message-ID: Subject: Re: New subsystem for acceleration devices To: Dave Airlie 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,T_SCC_BODY_TEXT_LINE 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 Fri, Aug 5, 2022 at 6:03 AM Dave Airlie wrote: > > 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'm taking all what you wrote seriously, these are all good points. As I wrote to Jason, I don't want to jump the gun here. I think we should discuss this and explore the possibilities that you suggested because I would like to reach consensus if possible. Maybe this is something we can discuss in LPC or in the kernel summit ? Oded > > > 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.