@@ -231,6 +231,12 @@ NVCCFLAGS += -Wno-deprecated-gpu-targets \
231231 -gencode arch=compute_75,code=compute_75 \
232232 -gencode arch=compute_80,code=compute_80
233233
234+ else ifdef LLAMA_ARCHES_CU13
235+ NVCCFLAGS += -Wno-deprecated-gpu-targets \
236+ -gencode arch=compute_75,code=compute_75 \
237+ -gencode arch=compute_80,code=compute_80 \
238+ -gencode arch=compute_86,code=compute_86
239+
234240else
235241NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=all
236242endif
@@ -465,8 +471,13 @@ endif
465471
466472ifdef NO_VULKAN_EXTENSIONS
467473VKGEN_NOEXT_ADD = -DNO_VULKAN_EXTENSIONS
474+ VKGEN_SUFFIX = -noext
475+ else
476+ VKGEN_SUFFIX =
468477endif
469478VKGEN_NOEXT_FORCE = -DNO_VULKAN_EXTENSIONS
479+ VKGEN_HPP = ggml/src/ggml-vulkan-shaders$(VKGEN_SUFFIX ) .hpp
480+ VKGEN_CPP = ggml/src/ggml-vulkan-shaders$(VKGEN_SUFFIX ) .cpp
470481
471482#
472483# Print build information
@@ -679,9 +690,9 @@ ggml_v3-opencl.o: otherarch/ggml_v3-opencl.cpp otherarch/ggml_v3-opencl.h
679690 $(CXX ) $(CXXFLAGS ) $(CLBLAST_FLAGS ) -c $< -o $@
680691
681692# vulkan
682- ggml-vulkan.o : ggml/src/ggml-vulkan/ggml-vulkan.cpp ggml/include/ggml-vulkan.h ggml/src/ggml-vulkan-shaders.cpp
693+ ggml-vulkan.o : ggml/src/ggml-vulkan/ggml-vulkan.cpp ggml/include/ggml-vulkan.h $( VKGEN_CPP )
683694 $(CXX ) $(CXXFLAGS ) $(VKGEN_NOEXT_ADD ) $(VULKAN_FLAGS ) -c $< -o $@
684- ggml-vulkan-shaders.o : ggml/src/ggml-vulkan-shaders.cpp ggml/include/ggml-vulkan.h
695+ ggml-vulkan-shaders.o : $( VKGEN_CPP ) ggml/include/ggml-vulkan.h
685696 $(CXX ) $(CXXFLAGS ) $(VKGEN_NOEXT_ADD ) $(VULKAN_FLAGS ) -c $< -o $@
686697ggml-vulkan-noext.o : ggml/src/ggml-vulkan/ggml-vulkan.cpp ggml/include/ggml-vulkan.h ggml/src/ggml-vulkan-shaders-noext.cpp
687698 $(CXX ) $(CXXFLAGS ) $(VKGEN_NOEXT_FORCE ) $(VULKAN_FLAGS ) -c $< -o $@
@@ -701,11 +712,11 @@ expose.o: expose.cpp expose.h
701712 $(CXX ) $(CXXFLAGS ) -c $< -o $@
702713
703714# sd.cpp objects
704- sdcpp_default.o : otherarch/sdcpp/sdtype_adapter.cpp otherarch/sdcpp/stable-diffusion.h otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/util.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/thirdparty/zip.c
715+ sdcpp_default.o : otherarch/sdcpp/sdtype_adapter.cpp otherarch/sdcpp/stable-diffusion.h otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/util.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/tokenize_util.cpp otherarch/sdcpp/ thirdparty/zip.c
705716 $(CXX ) $(CXXFLAGS ) -c $< -o $@
706- sdcpp_cublas.o : otherarch/sdcpp/sdtype_adapter.cpp otherarch/sdcpp/stable-diffusion.h otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/util.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/thirdparty/zip.c
717+ sdcpp_cublas.o : otherarch/sdcpp/sdtype_adapter.cpp otherarch/sdcpp/stable-diffusion.h otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/util.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/tokenize_util.cpp otherarch/sdcpp/ thirdparty/zip.c
707718 $(CXX ) $(CXXFLAGS ) $(CUBLAS_FLAGS ) $(HIPFLAGS ) -c $< -o $@
708- sdcpp_vulkan.o : otherarch/sdcpp/sdtype_adapter.cpp otherarch/sdcpp/stable-diffusion.h otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/util.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/thirdparty/zip.c
719+ sdcpp_vulkan.o : otherarch/sdcpp/sdtype_adapter.cpp otherarch/sdcpp/stable-diffusion.h otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/util.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/tokenize_util.cpp otherarch/sdcpp/ thirdparty/zip.c
709720 $(CXX ) $(CXXFLAGS ) $(VULKAN_FLAGS ) -c $< -o $@
710721
711722
@@ -748,8 +759,8 @@ clean:
748759# useful tools
749760main : tools/main/main.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o ggml-repack.o $(OBJS_FULL ) $(OBJS )
750761 $(CXX ) $(CXXFLAGS ) $(filter-out % .h,$^ ) -o $@ $(LDFLAGS )
751- sdmain : otherarch/sdcpp/util.cpp otherarch/sdcpp/main.cpp otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/thirdparty/zip.c build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o ggml-backend_default.o ggml-backend-reg_default.o ggml-repack.o $(OBJS_FULL ) $(OBJS )
752- $(CXX ) $(CXXFLAGS ) $(filter-out % .h,$^ ) -o $@ $(LDFLAGS )
762+ sdmain : otherarch/sdcpp/util.cpp otherarch/sdcpp/main.cpp otherarch/sdcpp/stable-diffusion.cpp otherarch/sdcpp/upscaler.cpp otherarch/sdcpp/model.cpp otherarch/sdcpp/tokenize_util.cpp otherarch/sdcpp/ thirdparty/zip.c build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o ggml-backend_default.o ggml-backend-reg_default.o ggml-repack.o $(OBJS_FULL ) $(OBJS )
763+ $(CXX ) $(CXXFLAGS ) $(filter-out % .h,$^ ) -DKCPP_BAKE_SD_VOCAB - o $@ $(LDFLAGS )
753764whispermain : otherarch/whispercpp/main.cpp otherarch/whispercpp/whisper.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o ggml-backend_default.o ggml-backend-reg_default.o ggml-repack.o $(OBJS_FULL ) $(OBJS )
754765 $(CXX ) $(CXXFLAGS ) $(filter-out % .h,$^ ) -o $@ $(LDFLAGS )
755766ttsmain : tools/tts/tts.cpp common/arg.cpp build-info.h ggml.o ggml-cpu.o ggml-ops.o ggml-vec.o ggml-binops.o ggml-unops.o llama.o console.o llavaclip_default.o llava.o ggml-backend_default.o ggml-backend-reg_default.o ggml-repack.o $(OBJS_FULL ) $(OBJS )
@@ -779,7 +790,7 @@ vulkan-shaders-gen: ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp
779790 $(CXX ) $(CXXFLAGS ) $(VKGEN_NOEXT_ADD ) $(filter-out % .h,$^ ) -o $@ $(LDFLAGS )
780791ifeq ($(OS ) ,Windows_NT)
781792 @echo 'Now rebuilding vulkan shaders for Windows...'
782- $(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 --output-dir vulkan-spv-tmp
793+ $(shell) vulkan-shaders-gen --glslc glslc --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp $(VKGEN_HPP) --target-cpp $(VKGEN_CPP) --output-dir vulkan-spv-tmp
783794 @echo 'Vulkan Shaders Rebuilt for Windows...'
784795else
785796 @echo 'Now rebuilding vulkan shaders for Linux...'
813824 echo "Error: No usable glslc found. Vulkan shaders cannot be compiled!"; \
814825 else \
815826 echo "Using GLSLC: $$GLSLC_BIN"; \
816- ./vulkan-shaders-gen --glslc "$$GLSLC_BIN" --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp ggml/src/ggml-vulkan-shaders.hpp --target-cpp ggml/src/ggml-vulkan-shaders.cpp --output-dir vulkan-spv-tmp; \
827+ ./vulkan-shaders-gen --glslc "$$GLSLC_BIN" --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp $(VKGEN_HPP) --target-cpp $(VKGEN_CPP) --output-dir vulkan-spv-tmp; \
817828 fi
818829 @echo 'Vulkan Shaders Rebuilt for Linux...'
819830endif
0 commit comments