Announcement

Collapse
No announcement yet.

Playing With Vulkan Through Python, Basic Performance Figures To C++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Playing With Vulkan Through Python, Basic Performance Figures To C++

    Phoronix: Playing With Vulkan Through Python, Basic Performance Figures To C++

    The language bindings for the Vulkan high-performance graphics API have exploded since the debut of Vulkan 1.0 earlier this year. There's support from Rust to Java for interacting with this Khronos graphics API, including support for Python...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Considering that he/she is using ctypes and basically calling the C/C++ library directly the rendering should be about the same speed. I bet the main difference is the overhead of python and only because the FPS is so high it becomes more obvious. I tried to get it running on my Fedora 24 desktop with an NVIDIA GeForce GTX 780 and it first complains about an encoding issue which I fixed by adding a comment regarding utf-8 at the top, but then it doesn't like the "async" syntax later on, which I've never seen before. Still interesting to potentially see games written in python. Maybe even something integrated with pygame.

    Comment


    • #3
      Nice, now I can finally rest easy knowing that python is not vastly inferior to c++ when rendering a triangle in vulkan. I am sure it will be just as fast as the number of draw calls increases and is accompanied by the necessary game engine logic to actually produce something practically useful.

      What I am saying is such comparisons are entirely meaningless, so what's the big idea here?

      Comment


      • #4
        Originally posted by zeroepoch View Post
        Considering that he/she is using ctypes and basically calling the C/C++ library directly the rendering should be about the same speed. I bet the main difference is the overhead of python and only because the FPS is so high it becomes more obvious. I tried to get it running on my Fedora 24 desktop with an NVIDIA GeForce GTX 780 and it first complains about an encoding issue which I fixed by adding a comment regarding utf-8 at the top, but then it doesn't like the "async" syntax later on, which I've never seen before. Still interesting to potentially see games written in python. Maybe even something integrated with pygame.
        Ok... idiot me, I didn't realize it's actually python3. It now fails since it can't open libvulkan.so, which is another problem unrelated to the triangle script.

        Comment


        • #5
          Well, it shows that the "best case" overhead is relatively low and that "properly" tuned Vulkan programs in python can be viable.

          Any difference in pypy vs default cpython?

          I would try it, but...
          Code:
          $ python triangle.py
          Could not load function CreateWin32SurfaceKHR
          Could not load function CreateDebugReportCallbackEXT
          Could not load function DestroyDebugReportCallbackEXT
          Could not load function DebugReportMessageEXT
          WARNING: Ivy Bridge Vulkan support is incomplete
          Traceback (most recent call last):
           File "triangle.py", line 1670, in <module>
             main()
           File "triangle.py", line 1663, in main
             app = TriangleApplication()
           File "triangle.py", line 1603, in __init__
             Application.__init__(self)
           File "triangle.py", line 815, in __init__
             self.create_device()
           File "triangle.py", line 325, in create_device
             self.GetPhysicalDeviceSurfaceSupportKHR(self.gpu, index, surface, byref(supported))
          ctypes.ArgumentError: argument 3: <class 'TypeError'>: wrong type
          Application freed!

          Comment


          • #6
            nvm...

            Comment


            • #7
              ooops double post.

              Comment


              • #8
                Originally posted by haagch View Post
                Well, it shows that the "best case" overhead is relatively low and that "properly" tuned Vulkan programs in python can be viable.
                Let's hold our breath for those AAA titles written in pyton

                Civilization V uses lua for scripting and it is so damn sluggish, I don't even want to imagine what would be if the actual game was written in it... I guess an interpreted language would be OK for some trivial game - no more than 10-20k loc, but for everything more sophisticated it is out of the question. Too memory inefficient, too much execution overhead.

                One has to note that the "performance" in this case is far from illustrative of the real life overhead. It is a static scene, once all the data is transferred to the GPU and the command buffer is created, all you have to do is execute it for every frame. FPS is meaningless in this context, it would be far more beneficial to time how long it takes to setup the device, transfer the data and set the command buffers.

                Comment


                • #9
                  There's more than AAA games out there. From what I hear in scientific visualization python isn't uncommon. So it could still be useful for, I don't know, rendering large point clouds and stuff.

                  Comment


                  • #10
                    Has an interpreter been used or a jit?

                    Comment

                    Working...
                    X