The famous epic L.N. Tolstoy finds use in NVIDIA CUDA as an Easter egg and more

©

User CHDuckie from the NVIDIA subreddit noticed a large file located in the NVIDIA CUDA folder on his hard drive. The file was named “warandpeace.txt”. The file was much larger than the other codes in the folder and weighed in at 3212 KB compared to files under 10 KB.

Out of curiosity, the user used VS Code to open the file due to the large file size being too large for the standard Notepad application. Suddenly, 65,340 lines appear, the first line of which reads: “Project Gutenberg Leo Tolstoy’s War and Peace eBook.”


It seems appropriate to quote this particular quotation from the author’s work:

The ancients have left us models of heroic poems in which the heroes are the whole interest of history, and we still cannot get used to the fact that for our human time this kind of history has no meaning.

But why was the file there? It may seem like an odd choice for an easter egg, but the reason for putting Tolstoy’s masterpiece in the NVIDIA CUDA folder has practical implications.

Readers will remember that NVIDIA CUDA also serves as both a computing platform and a programming model for use in conventional GPU computing. CUDA allows users to speed up applications by harnessing the power of the GPU.


In the comments to the post, Reddit user jlouis8 explains the likely reason why the file is there.

It is used in code here: https://github.com/NVIDIA/cuda-samples/blob/master/Samples/0_Introduction/c%2B%2B11_cuda/c%2B%2B11_cuda.cu#L97 The example creates a small CUDA kernel, which counts the letters w, x, y and z in some data. It then loads War and Peace into GPU memory and runs that kernel on the data. The reason this text was chosen is probably because it can be included for free without violating copyright, and is large enough that you can measure the difference depending on the method used, but small enough to complete quickly. Quite often, sample data is included in the code of an example so that its execution is self-contained. Or provide a way to download the specified data from a stable URI from the web. Some systems, such as R, include sample data in the standard library so you can easily demonstrate the methods.

See also  Hardware Info

Share:

Facebook
Twitter
LinkedIn

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

On Key

Related Posts