wsl配置vllm问题:ImportError: libcudart.so.12: cannot open shared object file: No such file or director
wsl配置vllm遇到的问题:ImportError: libcudart.so.12: cannot open shared object file: No such file or director
·
文章目录
因为vllm貌似不太支持windows,在wsl上配置vllm遇到的一些问题总结,提供一些参考。
1. wsl配置代理
在windows中使用网络代理,但是wsl会提示无法使用。
解决:
- 在C:\Users\<用户名>目录下创建文件.wslconfig
- 将下面内容写入.wslconfig
[wsl2]
networkingMode=mirrored
autoProxy=true
- 重新启动wsl
wsl --shutdown
参考链接:
2. ImportError: libcudart.so.12: cannot open shared object file: No such file or directory
原因:
libcudart.so.12是cuda runtime的核心库。上面提示你并没有该库。
所以你需要安装cuda toolkit,cuda toolkit是NVIDIA提供开发GPU的工具和库,包含编译工具nvcc,运行时库cuda runtime。
解决:
# 添加 NVIDIA CUDA 仓库
sudo wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
sudo apt-get update
# 安装 CUDA Toolkit(选择版本,比如 12.4)
sudo apt-get install cuda-toolkit-12-4
3. ImportError: libtorch_cuda.so: cannot open shared object file: No such file or directory
原因:
pytorch版本不带cuda。可以使用下面代码进行检测。
python -c "import torch; print(torch.version.cuda); print(torch.cuda.is_available())"按照官方手册教程GPU - vLLM,好像安装的是cpu版本的vllm。
解决:
重新下载带cuda的pytorch。
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
更多推荐
所有评论(0)