Jump to content

Vulkan - new graphics API


Recommended Posts

On 20/01/2023 at 12:50 PM, andy5995 said:

An AppImage I made in an Ubuntu Jammy container worked on my Laptop with the Intel video. An AppImage I made in a Focal container did not.

I installed Ubuntu Focal on my Laptop (with the Intel GPU). I built 0ad from svn and Vulkan was detected. The AppImage I built with Focal didn't detect Vulkan on that laptop. So that tells me this issue is an AppImage problem, not a 0ad problem. :) It's a safe bet that the same would hold true for builds on Bionic.

Edited by andy5995
Link to comment
Share on other sites

Hi all, I recently tested build 27504 of the game with 0ad-spirv shader mod installed, but when I switch to Vulcan, this error appears:

Vulkan can not find any supported and suitable device.

Unbale to access device for Vulkan backend, switching to GL.

Spoiler

0ad-vulkan-error.png

My build is:

CPU: AMD FX 8350

GPU: NVIDIA GTX 970 (latest driver 528.24)

RAM: 14 GB DDR3

Note: I don't have problem playing other games using Vulkan (e.g. Read Dead Redemption 2).

Also game runs fine as it should using OpenGl.

Can anyone take a look and help me? Thanks

Link to comment
Share on other sites

17 minutes ago, DarkPulsar said:

Hi all, I recently tested build 27504 of the game with 0ad-spirv shader mod installed, but when I switch to Vulcan, this error appears:

Hi! Could you attach your mainlog.html after running the game with Vulkan selected? Paths to logs you might find here: https://trac.wildfiregames.com/wiki/GameDataPaths

Link to comment
Share on other sites

yesterday the game crashed while testing. Seems like it was just an out of memory problem on windows.

Assertion failed: "0 && (L"FYI: WARN_IF_FALSE reports that a function failed. Feel free to ignore or suppress this warning.")"
Location: wdbg_sym.cpp:91 (InitDbghelp)

Call stack:

While generating an error report, we encountered a second problem. Please be sure to report both this and the subsequent error messages.
errno = 0 (No error reported here)
OS error = 8 (Not enough memory resources are available to process this command.)


Call stack:

7744BB1F

errno = 13 (Insufficient access rights to open file)  

I am mentioning it tho, since the last thing in the mainlog was

ERROR: Failed to create VkBuffer: -2

 

Link to comment
Share on other sites

2 hours ago, vladislavbelov said:

Here is the new main log:

I see this difference (added lines) with a quick look:

Spoiler

<p> hasRequiredExtensions: Y hasOutputToSurfaceSupport: N</p>

<p> graphicsQueueFamilyIndex: 0 presentQueueFamilyIndex: 0 families: 2</p>

<p> maxBoundDescriptorSets: 32</p>

<p> Surface format: 44 colorSpace: 0 Supported: Y</p>

<p> Surface format: 50 colorSpace: 0 Supported: N</p>

<p> Surface format: 64 colorSpace: 0 Supported: N</p>

 

Also, NVidia says my GPU (GTX 970) fully supports Vulkan 1.3 (i have driver version 528.24), as you can see in the link that @leopard shared: https://developer.nvidia.com/vulkan-driver

In this site it says:

Spoiler

NVIDIA provides full Vulkan 1.3 support and functionality on NVIDIA GeForce and Quadro graphics card with one of the following Ada Lovelace, Ampere, Turing, Volta, Pascal and Maxwell (first and second generation) based GPUs:

"Maxwell 2 GPU Architecture

TITAN: GeForce GTX TITAN X

GeForce: GeForce GTX 980 Ti, GeForce GTX 980, GeForce GTX 980M, GeForce GTX 970, GeForce GTX 970M, GeForce GTX 965M, GeForce GTX 960, GeForce GTX 950,

Quadro: Quadro M6000 24GB, Quadro M6000, Quadro M5500, Quadro M5000, Quadro M5000M, Quadro M4000, Quadro M4000M, Quadro M3000M, Quadro M2200, Quadro M2000"

 

Also I have not used the beta driver, as this is my primary PC. I see that this vulkan "methods have been added with the beta driver (528.34):

Spoiler

Vulkan Beta Driver Release Updates

January 23rd, 2023 - Windows 528.34, Linux 525.47.06

  • New:
    • Support for all remaining VK_EXT_extended_dynamic_state3 states:
      • VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT
      • VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT
      • VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT
      • VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT
      • VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT
      • VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT
      • VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT
      • VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT
      • VK_DYNAMIC_STATE_SAMPLE_MASK_EXT
      • VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV
      • VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV
      • VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV
      • VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV
      • VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV
      • VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV
      • VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV
      • VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV
      • VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV
      • VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV
      • VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT
  • Fixes:
    • Fixed the supported 444 format reporting based on the h.265 video profiles for Maxwell and Pascal GPUs
    • Allow the use of VkVideoEncodeUsageInfoKHR and VkVideoDecodeUsageInfoKHR to be chained to VkVideoProfileInfoKHR structure
    • Handle error with video surfaces incorrectly created without the proper video usage flags
    • Handle the conditions for requiring VkVideoEncodeH264RateControlInfoEXT per the Vulkan spec VUID-VkVideoCodingControlInfoKHR-flags-07021
  • open-gpu-kernel-modules release:

 

Thanks for all your effort! Please if you want something else, inform me. Thank you again :)

mainlog.html

  • Like 1
Link to comment
Share on other sites

If Vulkan is enabled in the config, but the 0ad-spirv mod is not enabled, the game crashes. I've noticed since I first started testing with the Vulkan backend, and last checked at r27513. I have to edit user.cfg to change the backend to opengl, then enable the mod, then set the backend to Vulkan again.


 

Sound: AlcInit success, using OpenAL Soft
FILES| UserReport written to '/home/andy/.config/0ad/logs/userreport_hwdetect.txt'
TIMER| RunHardwareDetection: 4.66227 ms
FILES| Hardware details written to '/home/andy/.config/0ad/logs/system_info.txt'
TIMER| write_sys_info: 16.2635 ms
Assertion failed: "0 && (L"Can't find a usable technique")"
Location: ShaderManager.cpp:269 (LoadTechnique)

Call stack:

(0x56156f637a5e) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x637a5e) [0x56156f637a5e]
(0x56156f5ec261) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x5ec261) [0x56156f5ec261]
(0x56156f5ed7eb) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x5ed7eb) [0x56156f5ed7eb]
(0x56156f5ee064) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x5ee064) [0x56156f5ee064]
(0x56156f3b8641) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x3b8641) [0x56156f3b8641]
(0x56156f3ba5a8) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x3ba5a8) [0x56156f3ba5a8]
(0x56156f3ba81c) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x3ba81c) [0x56156f3ba81c]
(0x56156f3e7659) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x3e7659) [0x56156f3e7659]
(0x56156f3e7914) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x3e7914) [0x56156f3e7914]
(0x56156f3ed68c) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x3ed68c) [0x56156f3ed68c]
(0x56156f2af1cd) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x2af1cd) [0x56156f2af1cd]
(0x56156f0ad5f8) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0xad5f8) [0x56156f0ad5f8]
(0x56156f099478) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0x99478) [0x56156f099478]
(0x7f3ccf43c290) /usr/lib/libc.so.6(+0x23290) [0x7f3ccf43c290]
(0x7f3ccf43c34a) /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7f3ccf43c34a]
(0x56156f0aae4a) /tmp/.mount_0ad-0.GI6udT/usr/bin/pyrogenesis(+0xaae4a) [0x56156f0aae4a]

errno = 0 (No error reported here)
OS error = ?


(C)ontinue, (S)uppress, (B)reak, Launch (D)ebugger, or (E)xit?
e
Redirecting call to abort() to mozalloc_abort

Segmentation fault (core dumped)

 

 

Link to comment
Share on other sites

17 hours ago, vladislavbelov said:

Thank you for the feedback! I think I found a possible reason. I'll add a fix to the code.

Thanks a lot @vladislavbelov ! The game now runs on my system with Vulkan without any errors for the moment!

(without changing anything from my side, like drivers etc, only game build 27519)

Also, I think that I noticed a small performance boost compared to OPENGL. Hope the performance keep getting better as this is the only thing this game really needs, especially in long games. We hope some day multithreading be a thing. But yeah, Vulkan seems to be superior ! :)  Here are my latest log:

mainlog.html

  • Like 1
Link to comment
Share on other sites

0AD SVN Rev. 27522

Debian Bookworm

NVidia 1660Ti driver 525.85.05 (from nvidia.com)

Vulkan + Mod 0ad-spirv 0.27.13 enable

Quote

ERROR: Program 'spirv/model_common' with required defines not found.

etc.

Quote

Engine exited successfully on 2023-02-02 at 08:14:00 with 1163 message(s), 192 error(s) and 0 warning(s).

The game proceeds normally. Nothing hangs.

 

mainlog2023-02-02_Rev_27522_vul;kan_GTX1660Ti_driver_525.85.05_0ad-spirv_0.27.13.html.zip

Edited by zyli
Link to comment
Share on other sites

On 11/01/2023 at 8:15 AM, vladislavbelov said:

Vulkan drivers from different vendors are usually much lighter than GL ones. That's the way to have less driver bugs and crashes. But we still need testing how it works on different hardware. So everyone who has a Vulkan compatible device please try to enable it in options (along with feedback). If you're able to run SVN then you already can test it. Else wait for the next RC. Note: to run the game you'd need to download and install a separate mod with precompiled shaders (it'll be bundled in RCs and the Release): https://releases.wildfiregames.com/rc/0ad-spirv.zip. Vulkan can't run pure GLSL shaders (which we use for GL), it uses a special binary format for shaders: SPIR-V.

Vulkan allows us to use different interesting features. For example it allows to select the most appropriate GPU to use. It means no more crashes because of wrong GPU, I hope :) Also Vulkan supports multithreading.

I am pushing latest svn branch  to it's limits with a ridiculously high amount of units right now (skirmish 8p map, 50k res, 25min peace, no pop limit, spamming houses and barracks, map discovered and revealed).

Vulkan is enabled and your shader mod is activated. For now, the graphics are set down quite a bit. The game is at 13-30fps with about 2000 units on the map. I attach the savegame so that you can test it aswelloverkillUnits.0adsaveimage.thumb.png.9ab38f225ba980e63054215ad0fed830.png

 

But i notice that the lag is purely graphical. The units are very responsive to movement commands. Good latency, different than what i experienced in multiplayer games.

Will test out the same scenario on a26 later. Not sure if the high latency is now gone because of a27 + vulkan or bcs of singleplayer.

Edited by sternstaub
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...