Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4776601pxv; Tue, 6 Jul 2021 08:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzKp0mIB67w+jzLZHqI7UF0kUQAc8LTp5bRSQgxPlmWiV7lGrF0BmYYRttBVv3aBhMHoQA X-Received: by 2002:a05:6e02:1251:: with SMTP id j17mr15088588ilq.217.1625586880501; Tue, 06 Jul 2021 08:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625586880; cv=none; d=google.com; s=arc-20160816; b=SGVEr0GKl55udMQHwP71gEYgJZnGRh3wrtf+tnuiu4rJQFH+jeipJ4zSnixuPwYtTP Qri0zYt6QrSlqitATu/1im/OIQDV7TKlc8iNvYtac0HnFubsXUhr6LV9iaTdVHJ0iZZ9 3M6TGzjexNH2GDyl0bZL+fRTAHyHHmCvOIBPXXdOc44J7C1WnZaAMGp5U3XZh0RzvQSa 5C3wRp+yDkEt4wrWvNny+Dtt95mkmoM32ko9uzBK0AEW4Ux2iMjy7uA+wKjapLfL76hj SPk0TkHzRH4xTyFZddBcWD6DP3lBK0qwu4GsPEXfMVKlcFApvIRfDvLrP5fMgp+rG8NX 0oJg== 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=XWcbFbfZlrlLCI/ycorf+8mN/ARHdyCO3tRbWLAh3y4=; b=Eq/lcOUSk5y5CBVp1iHgo328Jw8PEwpaWns8i9mtmjbAleXHgztnqIXlBeNKt2zyxh ar2SGWdfd96KtYeFL0YkCXSImqbQmb4AaqtCP9vHRL5SE23qGGkC4g/K2g1f8yL92lej YvpdnJB3/LQUe/qV3zF/TioLovVQtxtmMzRlEqGLQcDWEE6eSdTYUADv0PcVIxvcfGBV peHP5OX48127Sg1yC/Gc3bX9CBfxqFN96sFlGKGObL3G7NyUWol3wJJ8xnaZVHwJdCtu p6b1I9CiDtcnH9Bou+gAJnNobB8s5sYNgZ+uMFvrcvCfLOfjx+tM4jn6g8q0rdFVHly1 ORmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=btW4iaoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si17838852jaq.102.2021.07.06.08.54.25; Tue, 06 Jul 2021 08:54:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=btW4iaoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232782AbhGFPzk (ORCPT + 99 others); Tue, 6 Jul 2021 11:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbhGFPzj (ORCPT ); Tue, 6 Jul 2021 11:55:39 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 147EDC06175F for ; Tue, 6 Jul 2021 08:53:01 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id s17so25118194oij.0 for ; Tue, 06 Jul 2021 08:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XWcbFbfZlrlLCI/ycorf+8mN/ARHdyCO3tRbWLAh3y4=; b=btW4iaoBA6H16g/oM/vv8wk2tqtkbRuVH7mGj2o+MbQM8BPIaU4hAnrGsLSqNyzHQw Xq2O8dxuedqFF1OlFjHtwDmzMOk8jtJXy9/FcwH6bADMxafS3ucOYBnryWdpf6eKiACK PqyFOw4DBfJAFrezaW0uTHh6SMhuzrdtU4nzw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XWcbFbfZlrlLCI/ycorf+8mN/ARHdyCO3tRbWLAh3y4=; b=QzfkXBufcm3D4cTxk9kZZ7IyFqeVJdMNg5N+Ezteu+tDkAKPCkE9TIGbFdvgQwGdxv ohylIhjFpdnjPiJK7NAJ9bJzu2chd7qAYGxss0ZuL0CSLizWTsNJoEr7eOqM7hIJ0nSi QAA1up/5QKPoIx8YI0aYEK96SpvfI4X9tG6D6hRiDx7bA9TJnjw+Rz6Zn//1pRX1xle7 CGINAZnFowNQnUKv2kt9dF3s54sPXlFhYWoLbxMXIEhEfHnR7PUalqQeYc6Epy3VJmhN ecnoiCF6EwwAGmmrEUr+hj8yKYfVG4PjIz4tFObvHqBx0HCOU2g0Qxy0tYwDC3sVbAPx JeLw== X-Gm-Message-State: AOAM530D/qizP1DWt2qjXvjazVhifHLJSFSAWKZaFwCbxfzKEYqiD9wQ pbel1ktULuF/3+F4EBXlMfDOzDnWHIKV7X1sqTw9MA== X-Received: by 2002:aca:5793:: with SMTP id l141mr953303oib.14.1625586780449; Tue, 06 Jul 2021 08:53:00 -0700 (PDT) MIME-Version: 1.0 References: <20210705130314.11519-1-ogabbay@kernel.org> <20210706134430.GL4604@ziepe.ca> <20210706145617.GO4604@ziepe.ca> In-Reply-To: <20210706145617.GO4604@ziepe.ca> From: Daniel Vetter Date: Tue, 6 Jul 2021 17:52:49 +0200 Message-ID: Subject: Re: [PATCH v4 0/2] Add p2p via dmabuf to habanalabs To: Jason Gunthorpe Cc: Oded Gabbay , Oded Gabbay , "Linux-Kernel@Vger. Kernel. Org" , Greg Kroah-Hartman , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , sleybo@amazon.com, Maling list - DRI developers , linux-rdma , Linux Media Mailing List , Doug Ledford , Dave Airlie , Alex Deucher , Leon Romanovsky , Christoph Hellwig , amd-gfx list , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 6, 2021 at 4:56 PM Jason Gunthorpe wrote: > On Tue, Jul 06, 2021 at 04:09:25PM +0200, Daniel Vetter wrote: > > Anyway, for anything that works like a gpu accelerator, like 3d accel, > > or parallel compute accel (aka gpgpu) or spatial compute accel (aka > > NN/AI) or maybe even fpga accel most of the magic to use the hardware > > is in this backend compiler, which translates from an IR into whatever > > your accelerator consumes. That's the part we really care about for > > modern accelerators because without that defacto the hardware is > > useless. Generally these chips have full-blown, if special purpose > > ISA, with register files, spilling, branches, loops and other control > > flow (sometimes only execution masks on simpler hw). > > I don't know if I see it so clearly as you do - at the end of the day > the user keys in the program in some proprietary (or open!) language > and and wack of propritary magic transforms it to "make it work". > > There are many barriers that prevent someone without the secret > knowledge from duplicating the end result of a working program. An > accelerator ISA is certainly one example, but I wouldn't overly focus > on it as the only blocker. Well we don't, we do just ask for the full driver stack to make the hw work. It's just that in the past most vendors choose to leave out the compiler/ISA from their open stack/specs. Well except nvidia, which still chooses to leave out everything aside from some very, very minimal thing around documenting display functionality. > Like you said below the NVIDIA GPU ISA seems known but the HW is still > not really useful for other reasons. > > Habana seems to have gone the other way, the HW is fully useful but we > don't have the ISA transformation and other details. You can actually use nvidia gpus, they're fully functional. If you install the blobby stack. Which is exactly the same thing as with habanalabs, plus/minus a few things at the fringes. In the end it's about drawing the line somewhere, so maybe we should merge the nvidia glue code that makes their blobby stack work better with upstream? There's quite a few pieces there, e.g. their display driver is by design a userspace driver, whereas with kernel modesetting it needs to be in the kernel to expose the common kms ioctl interfaces, so they've built up a glue layer to forward everything to userspace and back. On windows it works because there kernel code can have growing stacks and fun stuff like that, at least that's my understanding. Not really an option to just run the code in linux. I'm pretty sure nvidia would appreciate that, and maybe every once in a while they open up a header for a generation or two of products like they've done in the past. > Both cases seem to have ended up with something useless, and I have a > hard time saying nouveau has more right to be in the kernel tree than > Habana does. > > > > Honestly, I think GPU is approaching this backwards. Wayland should > > > have been designed to prevent proprietary userspace stacks. > > > > That's not possible without some serious cans of worms though. Wayland > > is a protocol, and you can't forbid people from implementing it. > > Otherwise all the compatible open implementations of closed protocols > > wouldn't be possible either. > > Well, in many ways so is Linux, but nobody would seriously > re-implement Linux just to produce a driver. Well in the gpu space for 2+ decades nvidia has been setting the standard, and the open stack has been trying to catch up by reimplementing the entire thing. It took a fair while. > > So I'm not clear what you're suggesting here we should do different. > > Not enabling proprietary stacks as above would be a good start. I'm still not sure what exactly you mean here. Like on the 3d side there's opengl and vulkan, and nvidia just has an entirely different implementation of that compared to any of the open drivers. That is a bit less code than linux, but it's not small, and reimplementing over decades is pretty much what happened. And if it's not allowed we'd actually not have an open 3d gpu stack at all, because only very recently did we get an agreement around the tracemark/licensing issues of that stuff with Khronos. Recently compared to the history of opengl at least. So I'm still not clear what exactly it is you're suggesting we should do? Not implement the industry standards for 3d (and accept we stay irrelevant forever)? Reject nvidia blobs harder than we do already? Distros will continue to ship an auto-installer for that stack, at least some, so we're pretty much maxed out already. Like in what way do you think the upstream stack does enable the proprietary nvidia stack? Should we permanently ban any contributions from anyone with an @nvidia.com address, even if it helps the open stack improve? Like I'm not seeing something concrete that could be done, which would actually prevent nvidia from having their completely independent stack, with exact same functionality and not a line of code shared. Which is were we are right now. The only thing where we could be more strict is to reject any contributions from them at all, just because we don't like them. That seems a bit too extreme -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch