1

I don't really know that much about graphics cards (except when it comes to buying), when talking about programming, I'm a huge noob. (Question 1) I'm not even sure if this is possible, but if I want my graphics card to compute a block of code, only that code, while my processor is running another, how do I do that?

I'm predicting it uses different threads, I feel like there should be a way to assign different processors to different threads.

(Question 2) Also, does LWJGL utilise the graphics card?

That's about all! Thanks!

Kaelinator
  • 360
  • 3
  • 17
  • 2
    I don't have any experience with that topic, but i found some links which might be helpful: https://github.com/pcpratts/rootbeer1 and http://stackoverflow.com/questions/2633483/best-approach-for-gpgpu-cuda-opencl-in-java – dunni May 01 '16 at 03:44

1 Answers1

2

Bear in mind that graphics card GPU architectures work very, very differently than a CPU. It's not like your graphics card is an "auxiliary CPU" which processes intensive code in a background code. Rather, graphics card process data in your video buffer -- basically pixels and 2D/3D geometry which gets directly mapped to the memory buffer which drives your display.

Software in the traditional sense is a sequence of instructions that run on the CPU. Accordingly, the instructions you write in Java (or C, or similar architectures) compiles to code which only run on CPUs, typically those of an x86 architecture.

In short, there's no way to do precisely what you're asking. However, there are some experimental frameworks that allow you to write code which can run on the GPU. CUDA (http://www.nvidia.com/object/cuda_home_new.html) is probably the most well known, but keep in mind it's a very different style of programming than traditional object-oriented langauges such as Java.

Anthony E
  • 11,072
  • 2
  • 24
  • 44