4

I have a some data in pytorch on the GPU, say,

x = torch.cuda.FloatTensor(500, 3).uniform_()

Is there any way to render this as a point cloud (ala https://matplotlib.org/gallery/mplot3d/scatter3d.html) without first transferring the data to the CPU?

I have looked at frameworks such as matplotlib, VisPy, mayavi, etc. But all of them seem to want data via the CPU and cannot handle a GPU pointer, say.

Does anyone know of a good method? Preferably, the plotting should be non-blocking such that I can have a live view of x during training. Any ideas?

talonmies
  • 70,661
  • 34
  • 192
  • 269
Julius
  • 735
  • 2
  • 6
  • 17
  • I can't answer your problem, but I am curious: Is the transfer to the cpu such a bottleneck? I can imagine that the plotting itself takes a lot of the time, and that transferring a tensor to the cpu could be neglectable in comparison. – randomwalker Feb 20 '19 at 15:43
  • 1
    On the CPU the bottleneck is definitely plotting, as you say. But since the data is already on the GPU, one should be able to show it quickly on the screen using e.g. OpenGL... I was just hoping that some Python library was available to do this. – Julius Feb 21 '19 at 16:06

0 Answers0