Code Monkey home page Code Monkey logo

grvk's Introduction

GRVK

GRVK is a Mantle to Vulkan translation layer.

Mantle was originally developed by AMD and DICE starting in 2013, in an effort to produce a low-overhead graphics API as an alternative to DirectX 11 and OpenGL 4. Mantle was discontinued in 2015, with only a few games ever supporting it. Support was dropped from the AMD drivers in 2019, and it was never compatible with Nvidia cards. Despite this short life, it spawned a new generation of graphics API, including Metal, DirectX 12 and Vulkan.

This project is an attempt to revive Mantle and make it run everywhere.

Current game support

Getting the latest build

Head over to the Releases page for the latest stable build. Development builds are available here.

Building manually

Requirements

NOTE: binutils 2.34 has known issues and should be avoided.

Compiling

# 32-bit
meson --cross-file build-win32.txt --prefix $(pwd) build.w32
cd build.w32
ninja

# 64-bit
meson --cross-file build-win64.txt --prefix $(pwd) build.w64
cd build.w64
ninja

mantle32.dll/mantle64.dll/mantleaxl32.dll/mantleaxl64.dll will be generated.

Usage

After dropping the DLLs in the game directory, GRVK will get loaded by the game at launch. By default, GRVK will create log files named grvk.log/grvk_axl.log in the same directory.

Environment variables

  • GRVK_LOG_LEVEL controls the log level. Acceptable values are trace, verbose, debug, info, warning, error or none.
  • GRVK_LOG_PATH controls the log file path. An empty string will disable logging to the file entirely.
  • GRVK_AXL_LOG_PATH similar to GRVK_LOG_PATH, but for the extension library (mantleaxl).
  • GRVK_DUMP_SHADERS controls whether to dump shaders (IL input, IL disassembly, and SPIR-V output). Pass 1 to enable.

Credits

grvk's People

Contributors

cherser-s avatar dougvj avatar joshua-ashton avatar k0bin avatar libcg avatar newbytee avatar totalcaesar659 avatar xantares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grvk's Issues

Star Swarm

Meta issue for the Star Swarm benchmark based on the Nitrous engine.

  • Working as of 0.4.0

Sniper Elite III

Games status:

  • Sniper Elite III --> Not working

Here's Log (it is created in the main folder) (no error output message):

=== GRVK 0.3.0 ===
I/grInitAndEnumerateGpus: app "SniperElite3" (00000000), engine "Asura" (00000000), api 00016000
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
I/grCreateDevice: 10DE:2204 "GeForce RTX 3090" (Vulkan 1.2.155, driver 461.92.0)

Supports also AMDVLK!

Hi,
this is not a bug, but you could mention also in release notes that AMDVLK is supported..
feel free to close..
just tested GRVK 0.2 on a RX Vega using latest AMDVLK v-2020.Q3.6 and all samples render correctly..
should work since v-2020.Q3.1 that added dynamic state access extension..
log:

=== GRVK 0.2.0 ===
I/grInitAndEnumerateGpus: app "(null)" (00000000), engine "(null)" (00000000), api 00000001
W/grGetExtensionSupport: STUB
I/grCreateDevice: 1002:687F "Radeon RX Vega" (Vulkan 1.2.152, driver 2.0.159)
W/initCmdBufferResources: HACK only one descriptor bound

Implement Advanced MSAA

BF4 uses it. Seems to require VK_AMD_shader_fragment_mask and VK_EXT_sample_locations at the very least.

Thief

Games status:

  • Thief--> Not working

Details:

Here's Thief Log: (no output error message)

=== GRVK 0.3.0 ===
I/grInitAndEnumerateGpus: app "Thief" (00000000), engine "Unreal3" (00000000), api 00015000
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB
I/grCreateDevice: 10DE:2204 "GeForce RTX 3090" (Vulkan 1.2.155, driver 461.81.0)
W/grCreateQueryPool: STUB

Implement amdmantle64.dll loader

Required by Frostbite games (BF4 and Dragon Age: Inquisition). For now these files can be extracted from the Adrenalin 19.4.3 drivers, but not redistributed with GRVK. We need to write our own implementation.

installed mesa 22.0 but receive error in grvk log

I previously opened an issue and did as you suggested. I installed mesa 22.0.

Tried running this via steam/protonGE and origin/lutris. (both did not work)

What am I missing here?

=== GRVK 0.5.0 ===
I/000003B4/grInitAndEnumerateGpus: app "Battlefield" (01000000), engine "Frostbite" (00C00000), api 00018000
I/000003B4/quirkInit: enabled 0x4
W/000003B4/grInitAndEnumerateGpus: unhandled alloc callbacks
W/000003B4/getGrPhysicalGpuType: unsupported type 4
W/000003B4/getGrPhysicalGpuType: unsupported type 4
I/000003B4/grCreateDevice: 1002:731F "AMD RADV NAVI10" (Vulkan 1.3.204, driver 22.0.99)
I/000003B4/grCreateDevice: DMA queue remapped to compute queue 1
I/000003B4/grCreateDevice: 10005:0000 "llvmpipe (LLVM 13.0.1, 256 bits)" (Vulkan 1.2.204, driver 0.0.1)
I/000003B4/grCreateDevice: compute queue remapped to universal queue 0
I/000003B4/grCreateDevice: DMA queue remapped to universal queue 0
E/000003B4/grCreateDevice: vkCreateDevice failed (-7)
E/000003B4/grCreateDevice: missing extension. make sure your Vulkan driver supports:
E/000003B4/grCreateDevice: - VK_EXT_custom_border_color
E/000003B4/grCreateDevice: - VK_EXT_extended_dynamic_state
E/000003B4/grCreateDevice: - VK_EXT_shader_demote_to_helper_invocation
E/000003B4/grCreateDevice: - VK_KHR_dynamic_rendering
E/000003B4/grCreateDevice: - VK_KHR_swapchain

I am not sure how to enable VK_KHR_dynamic_rendering other than ensuring I have the most up to date vulkan driver.

I see that LLVM shows 1.2 but my actual AMD driver shows vulkan 1.3 and when I checked "glxinfo | grep Mesa"
It printed this:
client glx vendor string: Mesa Project and SGI
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.1.0-devel (git-8335fdf 2022-02-08 impish-oibaf-ppa)
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.1.0-devel (git-8335fdf 2022-02-08 impish-oibaf-ppa)
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.1.0-devel (git-8335fdf 2022-02-08 impish-oibaf-ppa)

Looking for any suggestions or help you can provide. I'd really love to test this out.

linux support ?

hello,
It seems it doesnt compile on anything other than windows, is there a limitation somewhere, or it's just a lack of uinterest in the linux port ?

Use an offset buffer for typed memory views

Mantle doesn't have buffer view objects and games like to bind memory views with new offsets all the time, which means we're allocating and freeing VkBufferView objects very frequently, and we can't cache them. Use an offset buffer and do some magic in the shader to avoid this situation.

Battlefield 4

Meta-issue for Battlefield 4.

  • Working as of 0.5.0
  • Exclusive fullscreen (fixed with 6a0e4d8)
  • Tessellation
  • Vsync
  • #34
  • #32

grvk says vulkan extensions missing, but my vulkan version is 1.2.199

=== GRVK 0.5.0 ===
I/00000BDC/grInitAndEnumerateGpus: app "Battlefield" (01000000), engine "Frostbite" (00C00000), api 00018000
I/00000BDC/quirkInit: enabled 0x4
W/00000BDC/grInitAndEnumerateGpus: unhandled alloc callbacks
I/00000BDC/grCreateDevice: 1002:67DF "AMD RADV POLARIS10" (Vulkan 1.2.199, driver 21.99.99)
I/00000BDC/grCreateDevice: DMA queue remapped to compute queue 1
E/00000BDC/grCreateDevice: vkCreateDevice failed (-7)
E/00000BDC/grCreateDevice: missing extension. make sure your Vulkan driver supports:
E/00000BDC/grCreateDevice: - VK_EXT_custom_border_color
E/00000BDC/grCreateDevice: - VK_EXT_extended_dynamic_state
E/00000BDC/grCreateDevice: - VK_EXT_shader_demote_to_helper_invocation
E/00000BDC/grCreateDevice: - VK_KHR_dynamic_rendering
E/00000BDC/grCreateDevice: - VK_KHR_swapchain

Bugs on Intel HD 530 GPU on Windows using new 27.20.100.8778 beta driver with EXT_dynamic_state support

Hi,
great project, keep up the good work :-)

just found new Intel Win driver implements EXT_dynamic_state used by GRVK..
just a quick run run_microwaves shows not running ok..
log:
=== GRVK 0.2.0 ===
I/grInitAndEnumerateGpus: app "(null)" (00000000), engine "(null)" (00000000), api 00000001
W/grGetExtensionSupport: STUB
I/grCreateDevice: 8086:1912 "Intel(R) HD Graphics 530" (Vulkan 1.2.151, driver 0.402.586)
W/initCmdBufferResources: HACK only one descriptor bound
E/grWsiWinQueuePresent: vkQueueSubmit failed
E/grQueueSubmit: vkQueueSubmit failed
E/grWsiWinQueuePresent: vkQueueSubmit failed
E/grQueueSubmit: vkQueueSubmit failed
E/grWsiWinQueuePresent: vkQueueSubmit failed
E/grQueueSubmit: vkQueueSubmit failed

also have you GRVK tested on Anvil Mesa Intel driver on Linux..
at least it has also the required extension..

thanks..

Trying it via WINE or STEAM/Proton (using newest wine or GE on Steam)

I am using LInux/POPS OS 21.10 (basically ubuntu/debian)

=== GRVK 0.5.0 ===
I/00000A58/grInitAndEnumerateGpus: app "Battlefield" (01000000), engine "Frostbite" (00C00000), api 00018000
I/00000A58/quirkInit: enabled 0x4
W/00000A58/grInitAndEnumerateGpus: unhandled alloc callbacks
W/00000A58/getGrPhysicalGpuType: unsupported type 4
W/00000A58/getGrPhysicalGpuType: unsupported type 4
I/00000A58/grCreateDevice: 1002:731F "AMD RADV NAVI10" (Vulkan 1.2.182, driver 21.2.2)
I/00000A58/grCreateDevice: DMA queue remapped to compute queue 1
E/00000A58/grCreateDevice: vkCreateDevice failed (-7)
E/00000A58/grCreateDevice: missing extension. make sure your Vulkan driver supports:
E/00000A58/grCreateDevice: - VK_EXT_custom_border_color
E/00000A58/grCreateDevice: - VK_EXT_extended_dynamic_state
E/00000A58/grCreateDevice: - VK_EXT_shader_demote_to_helper_invocation
E/00000A58/grCreateDevice: - VK_KHR_dynamic_rendering
E/00000A58/grCreateDevice: - VK_KHR_swapchain

I have tried installing the AMD driver and from what I can see it should work but it doesn't work. What am I doing wrong?

BF4, BF Hardline, DA:I, Plants vs. Zombies: Garden Warfare / Frostbite 3 Engine

Games status:

  • Battlefield 4 --> Not working
  • Battlefield Hardline --> Untested/Unknown
  • Dragon Age Inquisition --> Not working
  • Plants vs. Zombies: Garden Warfare --> Untested/Unknown

Details:

BF4 and Dragon Age Inquisiton Error Message (both the same)

Here's BF 4 log:

=== GRVK 0.3.0 ===
I/grInitAndEnumerateGpus: app "Battlefield" (01000000), engine "Frostbite" (00C00000), api 00018000
W/grInitAndEnumerateGpus: unhandled alloc callbacks
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB

Here's DAI log:

=== GRVK 0.3.0 ===
I/grInitAndEnumerateGpus: app "DragonAgeInquisition" (01000000), engine "Frostbite" (00FDE001), api 00018000
W/grInitAndEnumerateGpus: unhandled alloc callbacks
W/grGetExtensionSupport: STUB
W/grGetExtensionSupport: STUB

Image presentation crashes the application after window resize

If my window gets resized, I get Assertion failed: vkRes != VK_ERROR_OUT_OF_DATE_KHR due to OUT_OF_DATE swapchain image acquire result not being handled. This logic doesn't allow to properly launch an application on tiling window managers at all (without forcing floating mode at launch).

I think it's better to get rid of VK_KHR_Swapchain usage completely because Mantle doesn't use swapchain logic at all and only uses presentation images, while leaving handling window events (like resizing), which leads to swapchain invalidation to the client. I have already fixed this in ddef5b6.

Heap issue in Nvidia GPU - Star Swarm Benchmark

memoryProperties.memoryTypeCount returns 11 heaps, but on the 10th heap the device handle changes abruptly and causes a memory access violation, it only works if I limit it to 9 heaps, below 9 heaps GR_GPU_MEMORY becomes null in grMapMemory()

System information

  • GPU: Nvidia GeForce GTX 1050 Ti
  • Driver: 455.50.07
  • Wine version: wine-tkg-staging-fsync-git 6.2.r5.gaa8a3d90-322 (chaotic-aur)
  • GRVK version: master

Log files

grvk-8-heaps.log
grvk-11-heaps.log

Thief

Meta-issue for Thief

  • Working?
  • ???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.