mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	make : support customized LLAMA_CUDA_NVCC and LLAMA_CUDA_CCBIN (#2275)
Under certain environment, nvcc and gcc is installed under customized path but not standard path Co-authored-by: Yan Lin <yanlin@baidu.com>
This commit is contained in:
		
							
								
								
									
										10
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile
									
									
									
									
									
								
							| @@ -193,8 +193,12 @@ ifdef LLAMA_CUBLAS | |||||||
| 	CXXFLAGS  += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include | 	CXXFLAGS  += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include | ||||||
| 	LDFLAGS   += -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -L/usr/local/cuda/lib64 -L/opt/cuda/lib64 -L$(CUDA_PATH)/targets/x86_64-linux/lib | 	LDFLAGS   += -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -L/usr/local/cuda/lib64 -L/opt/cuda/lib64 -L$(CUDA_PATH)/targets/x86_64-linux/lib | ||||||
| 	OBJS      += ggml-cuda.o | 	OBJS      += ggml-cuda.o | ||||||
| 	NVCC      = nvcc |  | ||||||
| 	NVCCFLAGS = --forward-unknown-to-host-compiler | 	NVCCFLAGS = --forward-unknown-to-host-compiler | ||||||
|  | ifdef LLAMA_CUDA_NVCC | ||||||
|  | 	NVCC = $(LLAMA_CUDA_NVCC) | ||||||
|  | else | ||||||
|  | 	NVCC = nvcc | ||||||
|  | endif #LLAMA_CUDA_NVCC | ||||||
| ifdef CUDA_DOCKER_ARCH | ifdef CUDA_DOCKER_ARCH | ||||||
| 	NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH) | 	NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH) | ||||||
| else | else | ||||||
| @@ -223,7 +227,9 @@ ifdef LLAMA_CUDA_KQUANTS_ITER | |||||||
| else | else | ||||||
| 	NVCCFLAGS += -DK_QUANTS_PER_ITERATION=2 | 	NVCCFLAGS += -DK_QUANTS_PER_ITERATION=2 | ||||||
| endif | endif | ||||||
|  | ifdef LLAMA_CUDA_CCBIN | ||||||
|  |     NVCCFLAGS += -ccbin $(LLAMA_CUDA_CCBIN) | ||||||
|  | endif | ||||||
| ggml-cuda.o: ggml-cuda.cu ggml-cuda.h | ggml-cuda.o: ggml-cuda.cu ggml-cuda.h | ||||||
| 	$(NVCC) $(NVCCFLAGS) $(CXXFLAGS) -Wno-pedantic -c $< -o $@ | 	$(NVCC) $(NVCCFLAGS) $(CXXFLAGS) -Wno-pedantic -c $< -o $@ | ||||||
| endif # LLAMA_CUBLAS | endif # LLAMA_CUBLAS | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sky Yan
					Sky Yan