mikera / clisk

The Clojure Image Synthesis Kit
281 stars 13 forks source link

Hardware question #16

Open BorisKourt opened 8 years ago

BorisKourt commented 8 years ago

Does clisk use only CPU or does it tap into GPU resources?

If CPU does it take advantage of multi-threading?

I built a small image generation script that works on 4096px+ textures and would like to get a dedicated piece of hardware to pipe everything through. Just wondering if I should just focus on the CPU or get a good GPU.

Thank you for making this!

mikera commented 8 years ago

CPU only right now. It does make use of all available processors though.

There is actually a known performance problem in clisk with deeply nested generators. If I fix that you should get sub-second rendering even on CPUs, though it is a bit of intricate work as it required refactoring the code generation....

BorisKourt commented 8 years ago

Is there a way to figure out if I have a system with deeply nested generators?

Right now I am pushing an image through clisk and then your imagez library, and that ends up at about 23 seconds per image (I haven't tried to optimize anything on my end though.) The expensive steps seem to be shatter and turbulate (expected though.)

I will keep an eye out for updates.

Thanks!

mikera commented 8 years ago

A rough way to estimate this is to count the maximum level of nesting in the brackets.

The fundamental problem is that complexity currently grows as O(4^d) where d is the nesting depth of certain clisk functions. This is solvable but I haven't quite had time to fix it yet - will do this weekend if I get enough time.

BorisKourt commented 8 years ago

Using the wrong terminology here but: If I 'realize' a vector (ether to texture or something else) at each step (would cause loss of data) and then apply the next step, would this remove the aforementioned nesting? (or just slow things down haha)

mikera commented 8 years ago

Yeah you can render a texture and then use that texture elsewhere / in multiple places. Will definitely help performance if you do it right, but at the cost of a fixed resolution on the texture.