Skip to content

Commit 8c74520

Browse files
committed
added NO_VULKAN_EXTENSIONS flag to disable dp4a and coopmat if needed
1 parent 07a96d6 commit 8c74520

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ endif
392392
endif
393393
endif
394394

395+
ifdef NO_VULKAN_EXTENSIONS
396+
VKGEN_ADD = -DNO_VULKAN_EXTENSIONS
397+
endif
395398

396399
#
397400
# Print build information
@@ -585,7 +588,7 @@ ggml_v3-opencl.o: otherarch/ggml_v3-opencl.cpp otherarch/ggml_v3-opencl.h
585588

586589
#vulkan
587590
ggml-vulkan.o: ggml/src/ggml-vulkan/ggml-vulkan.cpp ggml/include/ggml-vulkan.h ggml/src/ggml-vulkan-shaders.cpp
588-
$(CXX) $(CXXFLAGS) $(VULKAN_FLAGS) -c $< -o $@
591+
$(CXX) $(CXXFLAGS) $(VKGEN_ADD) $(VULKAN_FLAGS) -c $< -o $@
589592

590593
# intermediate objects
591594
llama.o: src/llama.cpp ggml/include/ggml.h ggml/include/ggml-alloc.h ggml/include/ggml-backend.h ggml/include/ggml-cuda.h ggml/include/ggml-metal.h include/llama.h otherarch/llama-util.h
@@ -666,15 +669,17 @@ endif
666669

667670
vulkan-shaders-gen: ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp
668671
@echo 'Vulkan shaders need to be regenerated. This can only be done on Windows or Linux. Please stand by...'
669-
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
672+
$(CXX) $(CXXFLAGS) $(VKGEN_ADD) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
670673
ifeq ($(OS),Windows_NT)
671674
@echo 'Now rebuilding vulkan shaders for Windows...'
672675
$(shell) vulkan-shaders-gen --glslc glslc --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp ggml/src/ggml-vulkan-shaders.hpp --target-cpp ggml/src/ggml-vulkan-shaders.cpp
676+
@echo 'Vulkan Shaders Rebuilt for Windows...'
673677
else
674678
@echo 'Now rebuilding vulkan shaders for Linux...'
675679
${shell} chmod +x vulkan-shaders-gen
676680
${shell} chmod +x glslc-linux
677681
$(shell) ./vulkan-shaders-gen --glslc ./glslc-linux --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp ggml/src/ggml-vulkan-shaders.hpp --target-cpp ggml/src/ggml-vulkan-shaders.cpp
682+
@echo 'Vulkan Shaders Rebuilt for Linux...'
678683
endif
679684

680685
#generated libraries

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
#ifndef NO_VULKAN_EXTENSIONS
12
#ifndef GGML_VULKAN_COOPMAT_GLSLC_SUPPORT
23
#define GGML_VULKAN_COOPMAT_GLSLC_SUPPORT
34
#endif
45
#ifndef GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT
56
#define GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT
67
#endif
8+
#endif
79

810
#include "ggml-vulkan.h"
911
#include <vulkan/vulkan_core.h>

ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
#endif
3333

3434
#define ASYNCIO_CONCURRENCY 64
35+
#ifndef NO_VULKAN_EXTENSIONS
3536
#ifndef GGML_VULKAN_COOPMAT_GLSLC_SUPPORT
3637
#define GGML_VULKAN_COOPMAT_GLSLC_SUPPORT
3738
#endif
3839
#ifndef GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT
3940
#define GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT
4041
#endif
42+
#endif
4143

4244
std::mutex lock;
4345
std::vector<std::pair<std::string, std::string>> shader_fnames;

0 commit comments

Comments
 (0)