Is there a limit to the extent of operations you can do on a GPU?

For example, can you create dictionaries/hashmaps, like you would in Java or C#? What about receiving packets from a socket? Could you route them via the PCI Express bus, via the CPU and to the GPU?

I'm interested in using GPU to process network packet data at very low latency.

closed as off topic by haimg, soandos, Sathyajith Bhat Jan 11 '12 at 8:40

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.


GPUs don't have access to any hardware connected to the host.

The typical execution for GPU programs is:

  • data transferred from host memory to GPU device memory
  • GPU device does some processing
  • data transferred back from GPU device memory to host memory

and then the host does something useful with the data such as displaying it to the user or saving to file.

Memory transfer is not cost-free, so typically you need to accumulate enough data and then send it to the GPU device to make it worthwhile.

Something else to consider is that GPU devices are data parallel (as opposed to task parallel). Unlike CPUs, which can run different code in parallel, GPUs run the same code in parallel on different data. This makes them poor at doing things like being a web server, but great for certain scientific and mathematical problems where a problem can be parallelized.

If you need low-latency network packet processing, GPUs are unlikely to be suitable. You would need to:

  • receive the network packet
  • send it to the GPU (some latency)
  • process on GPU
  • send back to host (more latency)

The only way for GPUs to be feasible would be either if:

  • a single packet analysis could be parallelized into many smaller chunks
  • you are willing to wait for many network packets to come in and analyze a whole lot of them at once

Not the answer you're looking for? Browse other questions tagged or ask your own question.