Pycuda安装,与pycuda.driver.CompileError的解决

一、pycuda的安装

1、首先确定自己电脑的cuda、cudnn、python版本

2、查看自己应该安装哪个版本,登录网站Pycuda版本网站

前面pycuda-2020.1是版本号,cuda102是cuda版本为10.2,cp36表示python版本为python3.6。
于是自己要安装的版本号。

3、安装之前先导入cuda的路径:

export PATH=/usr/local/cuda/bin:/usr/local/cuda/bin:$PATH

安装命令

pip install pycuda==2020.1

安装完成

二、排坑:自己遇到的错误:此时可能原因是与你的gpu支持的算力不匹配

1.pycuda.driver.CompileError;  nvcc fatal:

解决办法:
修改源码:path:/home/zxb/anaconda3/envs/vortx/lib/python3.9/site-packages/pyc

(gprMax) D:\2025Spring\sx\gprMax-v.3.1.7>pip install pycuda Collecting pycuda Using cached pycuda-2025.1.1.tar.gz (1.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pytools>=2011.2 (from pycuda) Using cached pytools-2025.2.2-py3-none-any.whl.metadata (2.9 kB) Requirement already satisfied: platformdirs>=2.2.0 in d:\programdata\anaconda3\envs\gprmax\lib\site-packages (from pycuda) (4.3.7) Collecting mako (from pycuda) Using cached mako-1.3.10-py3-none-any.whl.metadata (2.9 kB) Collecting siphash24>=1.6 (from pytools>=2011.2->pycuda) Using cached siphash24-1.7.tar.gz (19 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] + meson setup C:\Users\vbh\AppData\Local\Temp\pip-install-17izxxe3\siphash24_21c071b7daa9462385aac2634bad2cca C:\Users\vbh\AppData\Local\Temp\pip-install-17izxxe3\siphash24_21c071b7daa9462385aac2634bad2cca\.mesonpy-kf7cokv8 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\vbh\AppData\Local\Temp\pip-install-17izxxe3\siphash24_21c071b7daa9462385aac2634bad2cca\.mesonpy-kf7cokv8\meson-python-native-file.ini The Meson build system Version: 1.8.2 Source dir: C:\Users\vbh\AppData\Local\Temp\pip-install-17izxxe3\siphash24_21c071b7daa9462385aac2634bad2cca Build dir: C:\Users\vbh\AppData\Local\Temp\pip-install-17izxxe3\siphash24_21c071b7daa9462385aac2634bad2cca\.mesonpy-kf7cokv8 Build type: native build Project name: python-siphash24 Project version: undefined ..\meson.build:4:0: ERROR: Compiler cl cannot compile programs. A full log can be found at C:\Users\vbh\AppData\Local\Temp\pip-install-17izxxe3\siphash24_21c071b7daa9462385aac2634bad2cca\.mesonpy-kf7cokv8\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
07-26
评论 6
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值