fix segfault
This commit is contained in:
parent
24c8840037
commit
724fac470f
|
|
@ -460,8 +460,7 @@ func LoadVulkanMgmt(vulkanLibPaths []string, capLibPaths []string) (int, *C.vk_h
|
|||
|
||||
C.vk_init(vkLib, capLib, &resp)
|
||||
if resp.err != nil {
|
||||
slog.Debug("Unable to load vulkan", "library", vkLibPath, "error", C.GoString(resp.err))
|
||||
slog.Debug("Unable to load libcap", "library", capLibPath, "error", C.GoString(resp.err))
|
||||
slog.Debug("Unable to load vulkan", "library", vkLibPath, capLibPath, "error", C.GoString(resp.err))
|
||||
C.free(unsafe.Pointer(resp.err))
|
||||
} else {
|
||||
return int(resp.num_devices), &resp.ch, vkLibPath, capLibPath
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ void vk_init(char* vk_lib_path, char* cap_lib_path, vk_init_resp_t *resp) {
|
|||
}
|
||||
|
||||
if (check_perfmon(&resp->ch) != 0) {
|
||||
resp->err = "Performance monitoring is not allowed. Please enable CAP_PERFMON or run as root to use Vulkan.";
|
||||
resp->err = strdup("performance monitoring is not allowed. Please enable CAP_PERFMON or run as root to use Vulkan.");
|
||||
LOG(resp->ch.verbose, resp->err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue