diff --git a/oci/catalog/apps/llamacpp.json b/oci/catalog/apps/llamacpp.json index b92aaf27..4000c129 100644 --- a/oci/catalog/apps/llamacpp.json +++ b/oci/catalog/apps/llamacpp.json @@ -305,9 +305,53 @@ } ] }, + { + "id": "vulkan", + "label": "Intel/AMD (Vulkan)", + "architectures": [ + "amd64" + ], + "image": { + "reference": "ghcr.io/ggml-org/llama.cpp:server-vulkan", + "registry": "ghcr.io", + "repository": "ghcr.io/ggml-org/llama.cpp", + "tag": "server-vulkan", + "digest": null, + "pull_policy": "resolve-selected-tag-to-architecture-digest-at-install" + }, + "device_requests": [ + { + "id": "gpu-render", + "path_prompt": "GPU render device", + "host_path_default": "/dev/dri/renderD128", + "mode": "0660", + "deny_write": false, + "gid_strategy": "host-device-gid", + "kind": "character-device", + "container_path_strategy": "same-as-host", + "drm_vendor_ids": [ + "0x8086", + "0x1002" + ] + } + ] + }, { "id": "rocm", "label": "AMD (ROCm)", + "amd_gfx_targets": [ + 90008, + 90010, + 90402, + 100300, + 110000, + 110001, + 110002, + 110500, + 110501, + 120000, + 120001 + ], "architectures": [ "amd64" ], diff --git a/oci/catalog/apps/ollama.json b/oci/catalog/apps/ollama.json index 0d61df43..8835e79e 100644 --- a/oci/catalog/apps/ollama.json +++ b/oci/catalog/apps/ollama.json @@ -410,9 +410,60 @@ } ] }, + { + "id": "vulkan", + "label": "Intel/AMD (Vulkan)", + "architectures": [ + "amd64" + ], + "image": { + "reference": "ollama/ollama:latest", + "registry": "docker.io", + "repository": "ollama/ollama", + "tag": "latest", + "digest": null, + "pull_policy": "resolve-selected-tag-to-architecture-digest-at-install" + }, + "device_requests": [ + { + "id": "gpu-render", + "path_prompt": "GPU render device", + "host_path_default": "/dev/dri/renderD128", + "mode": "0660", + "deny_write": false, + "gid_strategy": "host-device-gid", + "kind": "character-device", + "container_path_strategy": "same-as-host", + "drm_vendor_ids": [ + "0x8086", + "0x1002" + ] + } + ], + "environment": [ + { + "name": "OLLAMA_IGPU_ENABLE", + "value": "1" + } + ] + }, { "id": "rocm", "label": "AMD (ROCm)", + "amd_gfx_targets": [ + 90008, + 90010, + 90402, + 90500, + 100300, + 110000, + 110001, + 110002, + 110500, + 110501, + 120000, + 120001 + ], "architectures": [ "amd64" ], @@ -448,6 +499,12 @@ "kind": "character-device", "container_path_strategy": "same-as-host" } + ], + "environment": [ + { + "name": "OLLAMA_IGPU_ENABLE", + "value": "1" + } ] } ] diff --git a/oci/catalog/curated/llamacpp.json b/oci/catalog/curated/llamacpp.json index c67dbe87..5376f2d8 100644 --- a/oci/catalog/curated/llamacpp.json +++ b/oci/catalog/curated/llamacpp.json @@ -305,9 +305,53 @@ } ] }, + { + "id": "vulkan", + "label": "Intel/AMD (Vulkan)", + "architectures": [ + "amd64" + ], + "image": { + "reference": "ghcr.io/ggml-org/llama.cpp:server-vulkan", + "registry": "ghcr.io", + "repository": "ghcr.io/ggml-org/llama.cpp", + "tag": "server-vulkan", + "digest": null, + "pull_policy": "resolve-selected-tag-to-architecture-digest-at-install" + }, + "device_requests": [ + { + "id": "gpu-render", + "path_prompt": "GPU render device", + "host_path_default": "/dev/dri/renderD128", + "mode": "0660", + "deny_write": false, + "gid_strategy": "host-device-gid", + "kind": "character-device", + "container_path_strategy": "same-as-host", + "drm_vendor_ids": [ + "0x8086", + "0x1002" + ] + } + ] + }, { "id": "rocm", "label": "AMD (ROCm)", + "amd_gfx_targets": [ + 90008, + 90010, + 90402, + 100300, + 110000, + 110001, + 110002, + 110500, + 110501, + 120000, + 120001 + ], "architectures": [ "amd64" ], diff --git a/oci/catalog/overlays/ollama.json b/oci/catalog/overlays/ollama.json index 01ebbdb1..a8869d25 100644 --- a/oci/catalog/overlays/ollama.json +++ b/oci/catalog/overlays/ollama.json @@ -51,9 +51,60 @@ } ] }, + { + "id": "vulkan", + "label": "Intel/AMD (Vulkan)", + "architectures": [ + "amd64" + ], + "image": { + "reference": "ollama/ollama:latest", + "registry": "docker.io", + "repository": "ollama/ollama", + "tag": "latest", + "digest": null, + "pull_policy": "resolve-selected-tag-to-architecture-digest-at-install" + }, + "device_requests": [ + { + "id": "gpu-render", + "path_prompt": "GPU render device", + "host_path_default": "/dev/dri/renderD128", + "mode": "0660", + "deny_write": false, + "gid_strategy": "host-device-gid", + "kind": "character-device", + "container_path_strategy": "same-as-host", + "drm_vendor_ids": [ + "0x8086", + "0x1002" + ] + } + ], + "environment": [ + { + "name": "OLLAMA_IGPU_ENABLE", + "value": "1" + } + ] + }, { "id": "rocm", "label": "AMD (ROCm)", + "amd_gfx_targets": [ + 90008, + 90010, + 90402, + 90500, + 100300, + 110000, + 110001, + 110002, + 110500, + 110501, + 120000, + 120001 + ], "architectures": [ "amd64" ], @@ -89,6 +140,12 @@ "kind": "character-device", "container_path_strategy": "same-as-host" } + ], + "environment": [ + { + "name": "OLLAMA_IGPU_ENABLE", + "value": "1" + } ] } ] diff --git a/oci/tests/test_acceleration_profiles_of_the_host.py b/oci/tests/test_acceleration_profiles_of_the_host.py index dc0ec3f5..556a8eca 100644 --- a/oci/tests/test_acceleration_profiles_of_the_host.py +++ b/oci/tests/test_acceleration_profiles_of_the_host.py @@ -48,8 +48,25 @@ class HostProfileTests(unittest.TestCase): def test_an_amd_host_is_not_offered_nvidia(self, *_): amd = {"intel": [], "amd": [NODE], "nvidia": False} self.assertEqual(self.offered("frigate", amd, kfd=True)[0], ["none", "vaapi", "rocm"]) - self.assertEqual(self.offered("ollama", amd, kfd=True)[0], ["cpu", "rocm"]) - self.assertEqual(self.offered("llamacpp", amd, kfd=True)[0], ["cpu", "rocm"]) + self.assertEqual(self.offered("ollama", amd, kfd=True)[0], ["cpu", "vulkan", "rocm"]) + self.assertEqual(self.offered("llamacpp", amd, kfd=True)[0], ["cpu", "vulkan", "rocm"]) + + def test_a_radeon_780m_gets_rocm_as_experimental_with_its_generation(self, *_): + # gfx1103 is not among the kernels of the Ollama and llama.cpp ROCm + # images; it runs presented as gfx1100. Without its compute device, + # Vulkan still uses it. + amd = {"intel": [], "amd": [NODE], "nvidia": False, "amd_gfx_target": 110003} + for app in ("ollama", "llamacpp"): + with patch("proxmenux_oci.installer.confirm_experimental_rocm", return_value=True): + plan = self.offered(app, amd, kfd=True, answer="rocm")[2] + override = [item["value"] for item in plan["environment"] if item["name"] == "HSA_OVERRIDE_GFX_VERSION"] + self.assertEqual(override, ["11.0.0"], app) + if app == "ollama": + self.assertIn({"name": "OLLAMA_IGPU_ENABLE", "value": "1", "sensitive": False}, plan["environment"]) + self.assertEqual(self.offered(app, amd, kfd=False)[0], ["cpu", "vulkan"], app) + # Ollama leaves an integrated GPU out unless it is told to use it. + plan = self.offered("ollama", amd, kfd=False, answer="vulkan")[2] + self.assertIn({"name": "OLLAMA_IGPU_ENABLE", "value": "1", "sensitive": False}, plan["environment"]) def test_rocm_is_not_offered_without_its_compute_device(self, *_): amd = {"intel": [], "amd": [NODE], "nvidia": False} @@ -58,7 +75,7 @@ class HostProfileTests(unittest.TestCase): def test_an_intel_and_nvidia_host_is_not_offered_amd(self, *_): both = {"intel": [NODE], "amd": [], "nvidia": True} self.assertEqual(self.offered("frigate", both)[0], ["none", "vaapi", "nvidia"]) - self.assertEqual(self.offered("llamacpp", both)[0], ["cpu", "nvidia", "intel"]) + self.assertEqual(self.offered("llamacpp", both)[0], ["cpu", "nvidia", "vulkan", "intel"]) def test_a_host_without_gpu_is_told_and_not_asked(self, *_): nothing = {"intel": [], "amd": [], "nvidia": False} diff --git a/oci/tests/test_ai_gpu_profiles.py b/oci/tests/test_ai_gpu_profiles.py index 548db08f..cbd4b38b 100644 --- a/oci/tests/test_ai_gpu_profiles.py +++ b/oci/tests/test_ai_gpu_profiles.py @@ -17,9 +17,11 @@ from test_advanced_flow_order import RecordingUI, storages RENDER, KFD = "/dev/dri/renderD128", "/dev/kfd" EXPECTED = { - "ollama": {"cpu": (":latest", []), "nvidia": (":latest", ["nvidia-runtime"]), "rocm": (":rocm", [RENDER, KFD])}, + "ollama": {"cpu": (":latest", []), "nvidia": (":latest", ["nvidia-runtime"]), "vulkan": (":latest", [RENDER]), + "rocm": (":rocm", [RENDER, KFD])}, "llamacpp": {"cpu": (":server", []), "nvidia": (":server-cuda", ["nvidia-runtime"]), - "rocm": (":server-rocm", [RENDER, KFD]), "intel": (":server-intel", [RENDER])}, + "vulkan": (":server-vulkan", [RENDER]), "rocm": (":server-rocm", [RENDER, KFD]), + "intel": (":server-intel", [RENDER])}, "faster-whisper": {"cpu": (":latest", []), "nvidia": (":gpu", ["nvidia-runtime"])}, "piper": {"cpu": (":latest", []), "nvidia": (":gpu", ["nvidia-runtime"])}, }