准备在vllm环境中进行qwen3.5模型的推理的时候引发了一系列环境问题。1.问题1首先是报错raise ValueError(ValueError: Duplicate device type cpu in backend string: nccl. The custom backend string argument is invalid: cpu:gloo,cpu:nccl.Custom backend string is an experimental feature where the backend string must be in the format:“device_type1:,device_type2:…”. e.g. ‘cpu:gloo,cuda:nccl’查阅资料后发现可能是gpu环境有问题实际在用cpu跑需要检查机器支持的cuda版本和实际安装的cuda版本是否一致。执行命令python -c import torch; print(cuda available:, torch.cuda.is_available()); print(GPU count:, torch.cuda.device_count())发现输出是cuda available: False也就是说pytorch确实找不到 GPU程序回退CPU运行。执行nvidia-smi发现系统cuda最高版本支持12.7但我之前是实际安装的是12.8cuda向下兼容12.8版本无法兼容。2.问题2qwen3.5要求vllm0.17.0但这个vllm版本下官方没有适配cuda12.7版本的预编译包。cuda12.7要求的numpy版本和vllm0.17.0要求的版本不兼容 。所以要自己从头编译。3.问题3自己从头编译比较吃cpu之前我安装flash-attention2的时候就曾经把服务器搞崩这里解决方法是手动设置最大cpu核心使用数保证剩余cpu能够支持系统以及系统上其他用户的算力。执行nproc检查一共多少cpu核心我设置了export MAX_JOBS16最多使用16个cpu核心。4**.问题4**报错error: enum “c10::ScalarType” has no member “Float8_e8m0fnu”} else if (b_scales.scalar_type() at::ScalarType::Float8_e8m0fnu) {原因是当前torch版本里面没有Float8_e8m0fnu数据类型但是需要编译的vllm版本中硬编码了这个数据类型。5.编译步骤最终找到一套适合的环境和编译步骤conda create-nvllmpython3.12-yconda activate vllmgitclone https://github.com/vllm-project/vllm.gitcdvllmgitcheckout v0.17.0# 清除之前 0.17.0 或 main 分支遗留的所有 C 编译垃圾gitclean-xfd# 清楚依赖关系python use_existing_torch.py# 解决torch没有Float8_e8m0fnu数据类型错误安装 PyTorch Nightly 版本pipinstall--pretorch --index-url https://download.pytorch.org/whl/nightly/cu124 pipinstall--upgradetransformers# 检查底层 C 编译器是否能顺利找到 Float8_e8m0fnugrepFloat8_e8m0fnu$(python-cimport torch; print(torch.__path__[0]))/include/c10/core/ScalarType.h# 设置cpu核心exportMAX_JOBS16echo$MAX_JOBS# 编译vllmpipinstall-e.--no-build-isolation# 为了防止冲突最后安装以下库pipinstall--pretorchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu124 --no-deps