当前位置: 首页 > news >正文

win11编译llama_cpp_python cuda128 RTX30/40/50版本

Geforce 50xx系显卡最低支持cuda128,llama_cpp_python官方源只有cpu版本,没有cuda版本,所以自己基于0.3.5版本源码编译一个RTX 30xx/40xx/50xx版本。

1. 前置条件

1. 访问https://developer.download.nvidia.cn/compute/cuda/12.8.0/local_installers/cuda_12.8.0_571.96_windows.exe安装cuda12.8 toolkit, 安装完成后在命令行输入“nvcc -V”确认如下信息:

Cuda compilation tools, release 12.8, V12.8.61

2. 使用visual studio installer 安装visual studio 2022,工作负荷选择【使用c++的桌面开发】,安装完成后将“VC\Tools\MSVC\<版本号>\bin\Hostx64\x64”对1应的路径加入环境变量;

3. 访问https://github.com/abetlen/llama-cpp-python/archive/refs/tags/v0.3.5-metal.tar.gz下载源码(国内镜像),下载后解压; 访问 https://github.com/ggml-org/llama.cpp/archive/refs/tags/b4831.tar.gz下载源码(国内镜像),下载后解压到 “llama_cpp_python\vendor\llama.cpp”

4. 访问https://github.com/conda-forge/miniforge/releases/download/24.11.3-0/Miniforge3-Windows-x86_64.exe安装miniforge;

2. 编译

conda create llama_build
conda activate llama_build
conda install ccahce
pip install build wheel

set CMAKE_ARGS=-DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86;89;120

cd C:\llama_cpp_python
python -m build --wheel

相关文章:

  • Trae:引领未来的 AI 编程新时代
  • nodejs学习——nodejs和npm安装与系统环境变量配置及国内加速
  • HPC超算系列2——新手指南1
  • PyTorch系列教程:Tensor.view() 方法详解
  • 定时器Tim输出比较(output compare)
  • Broken pipe
  • 十大数据科学Python库
  • 如何关闭 MySQL 的 binlog(Binary Log)日志
  • 系统架构设计师—系统架构设计篇—特定领域软件体系结构
  • ES Filter Query 区别
  • DeepSeek-Manus精品课合集【附下载】
  • 告别请帖制作难题,电子请帖一键生成!
  • 电话号码的字母组合
  • 数据结构--AVL树
  • 2020年联考《申论》第三题(河北县级卷)
  • ACM MM 2025 Overleaf 模板指导
  • swift -(5) 汇编分析结构体、类的内存布局
  • C++编程指南24 - 避免线程频繁的创建和销毁
  • Git系列之git tag和ReleaseMilestone
  • 23年以后版本pycharm找不到conda可执行文件解决办法
  • 欧美网站模板下载/网站优化网络推广seo
  • 南京代做网站制作/seo网址
  • 汕头网站建设浩森宇特/重庆网站seo多少钱
  • 资讯门户网站 dede/cps推广平台有哪些
  • 计算机编程入门/seo营销策划
  • wordpress新闻动态不显示作者/seo搜索优化服务