News for hackers. Stuff that matters.
Re:Libcu++: Nvidia C++ Standard Library by scott31 on Saturday September 19, 2020 @06:31AM (#24526447)
A pathetic attempt to lock developers into their hardware.
Re:Libcu++: Nvidia C++ Standard Library by jpz on Saturday September 19, 2020 @07:12AM (#24526618)
They seem to be pushing the barrier on innovation on GPU compute. It seems a little unfair to call that pathetic, whatever strategic reasons they have to find OpenCL unappetising (which simply enables their sole competitor in truth.)

Their decision making seems rational, of course it's not ideal if you're consumer. We would like the ability to bid off NVidia with AMD Radeon.

Convergence to a standard has to be driven by the market, but it's impossible to drive NVidia there because they are the dominant player and it is 100% not in their interests.

It doesn't mean they're a bad company. They are rational actors.

Re:Libcu++: Nvidia C++ Standard Library by my123 on Saturday September 19, 2020 @09:20AM (#24527236)
With nvc++, they are converging towards a standardised source code standard: https://developer.nvidia.com/blog/accelerating-standard-c-wi...

However, this notably doesn't cover binaries, which are GPU vendor specific in that case, so AMD for example would have to provide a C++ compiler implementing stdpar for GPUs targeted to their hardware.

Re:Libcu++: Nvidia C++ Standard Library by blelbach on Saturday September 19, 2020 @06:24PM (#24530715)
> A pathetic attempt to lock developers into their hardware

Ah-ha, you've caught us! Our plan is to lock you into our hardware by implementing Standard C++.

Once you are all writing code in Standard C++, then you won't be able to run it elsewhere, because Standard C++ only runs on NVIDIA platforms, right?

... What's that? Standard C++ is supported by essentially every platform?

Darnit! Foiled again.

Re:Libcu++: Nvidia C++ Standard Library by daniel-thompson on Saturday September 19, 2020 @06:52AM (#24526545)
I think CUDA itself is the locking attempt; this is just a tiny cherry on top.
Re:Libcu++: Nvidia C++ Standard Library by pjmlp on Saturday September 19, 2020 @09:23AM (#24527253)
The other vendors are to blame for sticking with outdated C and printf style debugging.
Re:Libcu++: Nvidia C++ Standard Library by einpoklum on Saturday September 19, 2020 @03:09PM (#24529733)
1. printf-style debugging is what we use on NVIDIA hardware too.

2. OpenCL 2.x allows for C++(ish) source code. Not sure how good the AMD support is though.

Re:Libcu++: Nvidia C++ Standard Library by pjmlp on Saturday September 19, 2020 @03:30PM (#24529856)
1. Ever heard of Nights and Visual Studio plugins?

2. OpenCL 2.0 was a failure, so OpenCL 1.2 got renamed as OpenCL 3.0. C++ bindings were dropped and SYSCL is now backend agnostic.

Re:Libcu++: Nvidia C++ Standard Library by einpoklum on Saturday September 19, 2020 @06:36PM (#24530769)
> 1. Ever heard of Nights and Visual Studio plugins?

Those are apples and oranges... also, you forget cuda-gdb.

> OpenCL 1.2 got renamed as OpenCL 3.0. C++ bindings were dropped

Well, yes, but also no. They were made optional, and transitioned to some other C++-cum-OpenCL initiative:

https://github.com/KhronosGroup/Khronosdotorg/blob/master/ap...

I'm not exactly sure how this differs and what's usable in practice though.

Re:Libcu++: Nvidia C++ Standard Library by pjmlp on Sunday September 20, 2020 @01:48AM (#24532140)
While SYSCL might stand a chance against CUDA, thanks to it being backend agnostic and a compiler neutral standard, C++ for OpenCL is a clang specific project which remains to be seen if it ever will get any adoption.

> For C++ kernel development, the OpenCL Working Group has transitioned from the original OpenCL C++ kernel language, defined in OpenCL 2.2, to the ‘C++ for OpenCL’ community, open-source project supported by Clang. C++ for OpenCL provides compatibility with OpenCL C, enables developers to use most C++17 features in OpenCL kernels, and is compatible with any OpenCL 2.X or OpenCL 3.0 implementation that supports SPIR-V™ ingestion.

https://www.khronos.org/news/press/khronos-group-releases-op...

Re:Libcu++: Nvidia C++ Standard Library by einpoklum on Sunday September 20, 2020 @12:36PM (#24534987)
> C++ for OpenCL is a clang specific project which remains to be seen if it ever will get any adoption.

About adoption - you're right. But about being Clang-specific - that's not an issue. That is, OpenCL is also specific to an OpenCL compiler; so the fact that compilation from C++-for-OpenCL to SPIR-V is clang-based is not a problem. We can still compile our host-side code with whatever compiler we like, but the runtime compiler of OpenCL C++ kernels will be clang-based.

Re:Libcu++: Nvidia C++ Standard Library by gj_78 on Saturday September 19, 2020 @09:10AM (#24527178)
Agree++. They are good at hardware and should stay that way.
Re:Libcu++: Nvidia C++ Standard Library by my123 on Saturday September 19, 2020 @09:17AM (#24527221)
The thing is: that hardware isn't very usable without good software, and an easy to use software stack at that.

That's what NVIDIA understood and made them what they are today.

Re:Libcu++: Nvidia C++ Standard Library by gj_78 on Saturday September 19, 2020 @09:32AM (#24527297)
A lot of hardware has builtin software, either inside a firmware or as a driver. Keeping the software part in firmware lets customer free to use any kind of OS. Using host cpu and memory is bad design IMHO.
Re:Libcu++: Nvidia C++ Standard Library by dahart on Saturday September 19, 2020 @10:15AM (#24527577)
Can you elaborate on what you mean? This is an open source library for developers to write code that can compile without changes on both CPU and GPU. This solves a problem that can’t be solved in firmware, and this is not a case of nvidia using cpu and host memory - whether to use cpu and host memory is strictly up to the developer.
Re:Libcu++: Nvidia C++ Standard Library by gj_78 on Saturday September 19, 2020 @01:23PM (#24529023)
Sorry, related to cpu and host memory , I was wrong. I meant : having the GPU seller control/write code that plays with host cpu and memory is bad. Let people use their own gcc/g++ or whatever compiler and publish the specs. Unless they also start selling CPUs.
Re:Libcu++: Nvidia C++ Standard Library by dahart on Saturday September 19, 2020 @02:11PM (#24529359)
This is gcc or whatever compiler, it is not nvidia's compiler. This library does not give nvidia any "control" over host operations, it gives developers another tool.

They did publish the specs, it's open source. BTW, Nvidia's acquisition of ARM means that it will be selling CPUs.

P.P.S., the driver runs on the host, so your proposed alternative doesn't address the point you think you're making.

Re:Libcu++: Nvidia C++ Standard Library by gj_78 on Saturday September 19, 2020 @03:05PM (#24529710)
I did not say the library controls anything, Nvidia controls the library : its features, its roadmap, its bugs corrections, development efforts (people) etc. All these choices are made by Nvidia. It is not just another tool , it is the tool that is closest to hardware evolution.

Nvidia buying ARM is not a good news for me. The same way I don't like them making software, I also don't like them selling CPUs or seafood. They are good at GPUs and that's OK.

The drivers are usually running in the kernel space and do not involve much of interaction with users. Firmware, on the other side, is hardware-close software and can be gradually replaced by specific hardware continuous improvements without the user/software or the OS noticing.

Re:Libcu++: Nvidia C++ Standard Library by blelbach on Saturday September 19, 2020 @07:02PM (#24530869)
> I did not say the library controls anything, Nvidia controls the library : its features, its roadmap, its bugs corrections, development efforts (people) etc. All these choices are made by Nvidia.

libcu++ is a fork of LLVM's libc++, which we do not control. We contribute upstream and engage with that community.

libcu++ is an implementation of the C++ Standard Library, which is controlled by an ISO standardization committee, which has about ~300 members, 10 of whom work at NVIDIA.

> The same way I don't like them making software, I also don't like them selling CPUs or seafood. They are good at GPUs and that's OK.

We employ more software engineers than hardware engineers. We don't sell hardware, we sell software + hardware.

We manufacture and sell CPUs today. I like to think we're quite good at it.

> The drivers are usually running in the kernel space and do not involve much of interaction with users.

Incorrect. The core part of the driver, called the Resource Manager (RM), runs in the kernel space. Each different SDK (CUDA, OpenGL, Vulkan, etc) has its own "user mode driver", which is a shared library that interacts with RM. It's hard to say what the split is, but I'd say roughly half of what you think of as "the driver" is in user mode.

> Firmware, on the other side, is hardware-close software and can be gradually replaced by specific hardware continuous improvements without the user/software or the OS noticing.

Firmware runs on the GPU. You can't do everything from the GPU.

But neither firmware nor drivers have anything to do with the toolchain that you use to write heterogeneous programs. That's what this is a part of.

Re:Libcu++: Nvidia C++ Standard Library by dahart on Saturday September 19, 2020 @03:35PM (#24529881)
> It is not just another tool , it is the tool that is closest to hardware evolution.

This is an open source library that meets the C++ standard, which is designed and contributed to by many companies, not just nvidia. Like AMD and Intel, Nvidia does release some proprietary things that your complaints might apply to, but this is not one of them.

Re:Libcu++: Nvidia C++ Standard Library by my123 on Saturday September 19, 2020 @09:37AM (#24527335)
> Keeping the software part in firmware lets customer free to use any kind of OS

Raspberry Pi initially shipped with such a graphics stack, with the Arm side just being a communication driver in the kernel and an RPC stack in user-space.

It isn't a good idea (for numerous reasons, including security) and is even more closed in practice than what ships today.

Re:Libcu++: Nvidia C++ Standard Library by gj_78 on Saturday September 19, 2020 @09:46AM (#24527380)
Raspberry Pi is not marketed for graphics as nvidia is doing with their GPUs. What I mean is that firmware is running on a usually small cpu and memory that is sold as a part of the GPU. No security issues here as the main security issue is to plug the whole GPU inside your PC.
Re:Libcu++: Nvidia C++ Standard Library by my123 on Saturday September 19, 2020 @10:10AM (#24527537)
With the complexity of GPU driver stacks, what you are asking for is not firmware, but a multi GHz+ set of CPUs just for that purpose.

+ RPC needed all the time... with its latency would tank the performance

It'd also be not tinkerable at all unlike what we have today, it's exactly advocating for the opposite of open.

Re:Libcu++: Nvidia C++ Standard Library by kortex on Saturday September 19, 2020 @10:30AM (#24527663)
That sounds like vendor binary blob sdk libraries, only everything is an rpc and you're not even in the same memory space, aka distributed computing, except you have no control over the device stack. Sounds kinda awful to me.
Re:Libcu++: Nvidia C++ Standard Library by blelbach on Saturday September 19, 2020 @06:56PM (#24530844)
> A lot of hardware has builtin software, either inside a firmware or as a driver.

Correct.

> Keeping the software part in firmware lets customer free to use any kind of OS.

Do you mean firmware, or firmware and driver?

You can't do everything in firmware.

> Using host cpu and memory is bad design IMHO.

How do you propose that you program the GPU then?

The CPU has to interact with the GPU. Some software has to manage that interaction.

That said, we are not talking about either a driver or firmware. This is a part of our toolchain. It is a library that you use when writing a heterogeneous program.

Re:Libcu++: Nvidia C++ Standard Library by blelbach on Saturday September 19, 2020 @05:55PM (#24530567)
We employ more software engineers than hardware engineers. Our hardware doesn't really do much in isolation, software is part of the product.
Re:Libcu++: Nvidia C++ Standard Library by gj_78 on Saturday September 19, 2020 @06:37PM (#24530775)
The question is not about the head count. How many software engineers at nvidia produce software that is expected run/compile on the host CPU of the customer, like this library ? I expect not too much.
Re:Libcu++: Nvidia C++ Standard Library by blelbach on Saturday September 19, 2020 @07:03PM (#24530875)
The majority of software engineers at NVIDIA write software that runs on the host CPU.

The majority of software written at NVIDIA (by any metric, lines of code, number of projects, etc) runs either solely on the CPU, or on both the CPU and the GPU.