Windows exception about amdvlk64.dll when trying to create a vulkan instance

0

I tried using vulkan, but I can't get it to work. When I try running the first sample given (compiled with VS 2019) with the SDK (01-init_instance.cpp) I get this exception when creating the Vulkan instance:

Exception thrown at 0x00007FFFE7EDAD11 (amdvlk64.dll) in game.exe: 0xC0000005:
Access violation reading location 0xFFFFFFFFFFFFFFFF.

I've tried it with app_info.apiVersion set to VK_API_VERSION_1_0 and VK_API_VERSION_1_1. Also tried setting inst_info.pApplicationInfo to NULL but I don't get any change in the behavior.

I am using an amd gpu AMD Radeon (TM) R9 390 Series, driver version is 17.1.1 and there are some other values about vulkan which are Vulkan™ Driver Version 1.5.0 and Vulkan™ API Version 1.0.39 (all picked from the amd driver interface)

And here is the sample:

#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;
}

Hopefully someone can help as apparently no one on the internet seems to understand why this happens.

windows
64-bit
amd
vulkan
asked on Stack Overflow Jul 5, 2019 by ctinarelli

1 Answer

0

Driver version 17.1.1 is very old (IIRC it means Jan 2017). In ideal world it should work, but as you experience there might be some compatibility issues.

Current drivers are at AMD Support site. They offer "recommended", or more current "optional" driver. Never had any problems with "optional", but it may nag to update more often.

answered on Stack Overflow Jul 6, 2019 by krOoze

User contributions licensed under CC BY-SA 3.0