Skip to content

b2275 Compilation works, but without CUDA acceleration 2024-02-26

Choose a tag to compare

@kreier kreier released this 07 Apr 19:03
· 35 commits to main since this release
4593b62

This edition was described in a gist by Flor Sanders from 2024-04-11. The compilation produces working main and llama-bench files. Unfortunately they are slow and only use the CPU. As soon as one layer should be exported to the CPU with --n-gpu-layers 1 the program crashes. No worries, you can download the binaries directly from his gist, they work with GPU acceleration and without crash.

The edit incorporates 3 edits to the Makefile:

diff --git a/Makefile b/Makefile
index 068f6ed0..a4ed3c95 100644
--- a/Makefile
+++ b/Makefile
@@ -106,11 +106,11 @@ MK_NVCCFLAGS = -std=c++11
 ifdef LLAMA_FAST
 MK_CFLAGS     += -Ofast
 HOST_CXXFLAGS += -Ofast
-MK_NVCCFLAGS  += -O3
+MK_NVCCFLAGS += -maxrregcount=80
 else
 MK_CFLAGS     += -O3
 MK_CXXFLAGS   += -O3
-MK_NVCCFLAGS  += -O3
+MK_NVCCFLAGS += -maxrregcount=80
 endif

 ifndef LLAMA_NO_CCACHE
@@ -299,7 +299,6 @@ ifneq ($(filter aarch64%,$(UNAME_M)),)
     # Raspberry Pi 3, 4, Zero 2 (64-bit)
     # Nvidia Jetson
     MK_CFLAGS   += -mcpu=native
-    MK_CXXFLAGS += -mcpu=native
     JETSON_RELEASE_INFO = $(shell jetson_release)
     ifdef JETSON_RELEASE_INFO
         ifneq ($(filter TX2%,$(JETSON_RELEASE_INFO)),)

It is followed by a simple call to make that takes 7 minutes to complete:

make LLAMA_CUBLAS=1 CUDA_DOCKER_ARCH=sm_62 -j 6