我尝试使用vulkan,但无法正常工作。当我尝试使用SDK(01-init_instance.cpp)运行给定的第一个示例(VS 2019编译)时,在创建Vulkan实例时遇到此异常:
Exception thrown at 0x00007FFFE7EDAD11 (amdvlk64.dll) in game.exe: 0xC0000005:
Access violation reading location 0xFFFFFFFFFFFFFFFF.
我已经尝试过将app_info.apiVersion
设置为VK_API_VERSION_1_0
和VK_API_VERSION_1_1
。也尝试设置inst_info.pApplicationInfo
为,NULL
但行为没有任何变化。
我正在使用amd gpu AMD Radeon (TM) R9 390 Series
,驱动程序版本是17.1.1
,还有关于vulkan的其他一些值是Vulkan™ Driver Version 1.5.0
和Vulkan™ API Version 1.0.39
(均从amd驱动程序接口中选取)
这是示例:
#include <iostream>
#include <cstdlib>
#include <util_init.hpp>
#define APP_SHORT_NAME "vulkansamples_instance"
int main(int, char *[]) {
VkApplicationInfo app_info = {};
app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
app_info.pNext = NULL;
app_info.pApplicationName = APP_SHORT_NAME;
app_info.applicationVersion = 1;
app_info.pEngineName = APP_SHORT_NAME;
app_info.engineVersion = 1;
app_info.apiVersion = VK_API_VERSION_1_0;
VkInstanceCreateInfo inst_info = {};
inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
inst_info.pNext = NULL;
inst_info.flags = 0;
inst_info.pApplicationInfo = &app_info;
inst_info.enabledExtensionCount = 0;
inst_info.ppEnabledExtensionNames = NULL;
inst_info.enabledLayerCount = 0;
inst_info.ppEnabledLayerNames = NULL;
VkInstance inst;
VkResult res;
res = vkCreateInstance(&inst_info, NULL, &inst);
if (res == VK_ERROR_INCOMPATIBLE_DRIVER) {
std::cout << "cannot find a compatible Vulkan ICD\n";
exit(-1);
} else if (res) {
std::cout << "unknown error\n";
exit(-1);
}
vkDestroyInstance(inst, NULL);
return 0;
}
希望有人能提供帮助,因为互联网上似乎没人能理解为什么会这样。
驱动程序版本17.1.1非常旧(IIRC表示2017年1月)。在理想的情况下,它应该可以工作,但是根据您的经验,可能存在一些兼容性问题。
当前的驱动程序在AMD支持站点上。他们提供“推荐”或更多当前的“可选”驱动程序。从未对“可选”有任何问题,但可能会更频繁地进行更新。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句