Hacker News new | ask | show | jobs
by dekhn 1038 days ago
I remember meeting with them in the mid aughts when they were first talking to HPC folks about using their cards for science. I'll never forget what the chief scientist from nVidia said. "What is the color of a NaN? That is, when you render a texture with a nan value, what does it look like? I'll tell: it's nvidia green."
4 comments

That is a funny way to signal their commitment to HPC! But compared to other tooling (non GPU) CUDA is still really clunky. Way ahead of everything else in the GPGPU space but still surprisingly clunky. Also I don't get what they are fearing with all their "Account required for download" (e.g. for CuDNN) what are they fearing? And is it really worth the trade-off for the pain it causes for dev environments and CI pipelines? It really seems like Intel and AMD have to step in to break this monopoly to force them to improve the situation for everyone.
No, you're not missing anything, NVIDIA's software is super clunky by the standards of most of the software world. However, for the last decade, the competition has been much worse: OpenCL development on AMD would be riddled with VRAM leaks, hard lockups, invisible limits on things like function length and registers that would cause the hard lockups when you tripped over them without any indication as to what you did wrong or how to fix it, that sort of thing. Cryptic error messages would lead to threads scattered around the internet, years old, with pleas for help and no happy endings.

The thing that caused me to ragequit the AMD ecosystem was when I took an OpenCL program I had been fighting for two days straight and ran it on my buddy's Nvidia system in hopes of getting an error message that might point me in the right direction. Instead, the program just ran, and it ran much faster, even though the nvidia card was theoretically slower.

In terms of quality, I expect the competition to catch up in a generation or two, but then there is still the decade+ of legacy code to consider. Hopefully with how fast AI/ML churns that isn't actually an insurmountable obstacle.

Years ago I gave up on OpenCL (1.2 on an AMD card) because of those hard lockups, with no way to debug it. nVidia didn't even support OpenCL 1.2 (and IIRC didn't support the synchronisation primitives I wanted in CUDA either -- AMD was more capable on paper). Thanks, I feel better to hear just how bad it was -- so it wasn't just my fault for quitting.
It's a quality meme but I'm having trouble figuring out the settings that make it work. It looks like RGBA8 would be blue:

    >>> struct.pack('f',math.nan)
    b'\x00\x00\xc0\x7f'
maybe that becomes green if you composite over white or something? Or maybe there is a common type of NaN that fills some of the unspecified bits? ("Just use the particular NaN that makes it green" is cheating unless you have an excuse)
They mean big-endian NaN, taking only the first 3 bytes. No alpha channel.

https://encycolorpedia.com/76b900 says Nvidia green #76b900.

Encycolorpedia looks like a great resource, thank you very much. A similar one would be Colorhexa. Not affiliated.

https://colorhexa.com

[Edit] Could not find it under the name, but it shows how color blind users perceive it. And it loads much faster.

https://www.colorhexa.com/76b900

[Edit] Encycolorpedia has a color blindness simulator too. Have to check on desktop.

Cool, thanks!
It was an arbitrary decision by the engineers who made the early GPUs, they just mapped NaN to an RGB

It was a nice way to debug tensors: render them to the screen, the green sticks out.

32-bit NaN is encoded: s111 1111 1xxx xxxx xxxx xxxx xxxx xxxx

Where both the sign (s) and the x bits can be anything and it will still be treated as a NaN.

There are lots of ways to encode colour, but there would be too much red with RGBA, and ARGB could be almost any opaque colour, but the red channel has to be at least 0x80, which is still too much red.

So NaNs are too red to encode nvidia green.

I once ended up having nans get interpreted as 32 bit colors accidentally, and it made everything red and white, like Christmas decoration.

Wonder what caused the difference in the latter bits being all 1 or 0 together.

I remember uni course on GPGPU and only discovering during first lecture Nvidia donated hardware to make sure it would be Cuda only course.