Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "gpu computing"
-
dammit. I fucking hate it when I get stuck because of low level computing concepts and there is no explanation on Google.
like.. I understand the difference between an int and a float, but no one ever explains how you convert 32bit signed vectors to floats. or how bgra and rgba differ. or how to composite two images on a GPU. etc. the internet is great and all, but fuck, sometimes it seems as everyone is just as dumb as I am.4 -
Follow-up to my previous story: https://devrant.com/rants/1969484/...
If this seems to long to read, skip to the parts that interest you.
~ Background ~
Maybe you know TeamSpeak, it's basically a program to talk with other people on servers. In TeamSpeak you can generate identities, every identity has a security level. On your server you can set a minimum security level you need to connect. Upgrading the security level takes longer as the level goes up.
~ Technical background ~
The security level is computed by doing this:
SHA1(public_key + offset)
Where public_key is your public key in Base64 and offset is an 8 Byte unsigned long. Offset is incremented and the whole thing is hashed again. The security level comes from the amount of Zero-Bits at the beginning of the resulting hash.
My plan was to use my GPU to do this, because I heared GPUs are good at hashing. And now, I got it to work.
~ How I did it ~
I am using a start offset of 0, create 255 Threads on my GPU (apparently more are not possible) and let them compute those hashes. Then I increment the offset in every thread by 255. The GPU also does the job of counting the Zero-Bits, when there are more than 30 Zero-Bits I print the amount plus the offset to the console.
~ The speed ~
Well, speed was the reason I started this. It's faster than my CPU for sure. It takes about 2 minutes and 40 seconds to compute 2.55 Billion hashes which comes down to ~16 Million hashes per second.
Is this speed an expected result, is it slow or fast? I don't know, but for my needs, it is fucking fast!
~ What I learned from this ~
I come from a Java background and just recently started C/C++/C#. Which means this was a pretty hard challenge, since OpenCL uses C99 (I think?). CUDA sadly didn't work on my machine because I have an unsupported GPU (NVIDIA GeForce GTX 1050 Ti). I learned not to execute an endless loop on my GPU, and so much more about C in general. Though it was small, it was an amazing project.1 -
Me working in High Performance Computing :
CPU/GPU in full throttle ... go brrrr...
Me working on an app:
Should put sleep() in the while loop so as not to overwork the CPU
😑😑2 -
Imagine buying a 16 tflops GPU from some manufacturer, yet the computing power is somehow shared, and when they need to produce some more GPUs, they just take some part of your 16 tflops, as well as from all the other people who bought these GPUs, so suddenly you have 15.6 tflops, yet money is never sent back to you, and you have no control over such decisions.
Oh, you tell me it's "robbery"? Yet federal reserve does the exact same thing by creating money out of thin air, basically taking their cuts off of every person's monetary value.
For your very real work, companies pay you with something that can be created out of thin air, and then that something loses its value when new tokens are created.
This is slavery. From now on, I'm going to call dollars "slave tickets".11 -
Since my XPS battery is dying I'm flirting with an idea of a new laptop. Requirements:
- 13" display
- 4k display (I'm so used to high-res that x1080 looks like accessibility mode)
- 16 (worst case), 32 (OK), 64 (possible?) GB RAM
- long battery life
- i7 or Ryzen equivalent (I need lots of ram, lots of computing power)
- plays nice with Linux
- GPU preferably integrated (don't need a separate GPU)
- ultrabook (small, compact, light) (I don't like to exercise while carrying it. God forbid I'd grow a muscle... )
- purrrrtty :)
So far the best candidate I've found is... XPS13 again :D The setup I'm after costs ~1.6k€ which is not that bad, really.
Is there anything else in the market that'd meet the criteria? Anything worth looking into? Better deals?19