mirror of
https://github.com/likelovewant/ollama-for-amd.git
synced 2025-12-21 14:26:30 +00:00
vulkan: Get FilterID from Backend for Vulkan (#12655)
* vulkan: Get FilterID from Backend for Vulkan * Fixing patch
This commit is contained in:
@@ -726,6 +726,9 @@ func (b *Backend) BackendDevices() []ml.DeviceInfo {
|
||||
}
|
||||
info.PCIID = fmt.Sprintf("%02x:%02x.%x", props.pci_bus_id, props.pci_device_id, props.pci_domain_id)
|
||||
info.LibraryPath = ggml.LibPaths()
|
||||
if props.numeric_id != nil {
|
||||
info.FilteredID = C.GoString(props.numeric_id)
|
||||
}
|
||||
|
||||
C.ggml_backend_dev_memory(dev, &props.memory_free, &props.memory_total)
|
||||
info.TotalMemory = (uint64)(props.memory_total)
|
||||
|
||||
2
ml/backend/ggml/ggml/include/ggml-backend.h
vendored
2
ml/backend/ggml/ggml/include/ggml-backend.h
vendored
@@ -178,6 +178,8 @@ extern "C" {
|
||||
int pci_device_id;
|
||||
int pci_domain_id;
|
||||
const char *library;
|
||||
// number with which the devices are accessed (Vulkan)
|
||||
const char *numeric_id;
|
||||
};
|
||||
|
||||
GGML_API const char * ggml_backend_dev_name(ggml_backend_dev_t device);
|
||||
|
||||
@@ -12640,6 +12640,7 @@ static void ggml_backend_vk_device_get_props(ggml_backend_dev_t dev, struct ggml
|
||||
props->pci_device_id = ctx->pci_device_id;
|
||||
props->pci_domain_id = ctx->pci_domain_id;
|
||||
props->library = GGML_VK_NAME;
|
||||
props->numeric_id = ctx->id.empty() ? nullptr : ctx->id.c_str();
|
||||
}
|
||||
|
||||
static ggml_backend_t ggml_backend_vk_device_init(ggml_backend_dev_t dev, const char * params) {
|
||||
|
||||
Reference in New Issue
Block a user