
其實初衷是想在alma中使用vllm。但是安裝編譯時提示出錯因為alma中是安裝的gcc8.4所以要想辦法解決這個問題。1、此版本不能再使用crb了這個已經棄用了使用powertools。dnf config-manager --set-enabled powertools2、嘗試安裝dnfinstallgcc-toolset-13-gcc gcc-toolset-13-gcc-c3、激活環境sclenablegcc-toolset-13bash4、版本已經正確了(base)[rootlocalhost yum.repos.d]# gcc --versiongcc(GCC)13.3.120240611(Red Hat13.3.1-2)Copyright(C)2023Free Software Foundation, Inc. This isfreesoftware;see thesourceforcopying conditions. There is NO warranty;not evenforMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.5、登錄生效echosource /opt/rh/gcc-toolset-13/enable~/.bashrcsource~/.bashrc6、繼續安裝vllm0.17.1如下是在anolis8.10中安裝。我的環境死活直接用命令安裝安裝不好。就是這個命令pipinstallvllm[cuda13x]0.17.1 或者 pipinstallvllm0.17.1 --extra-index-url https://download.pytorch.org/whl/cu131-ihttps://pypi.tuna.tsinghua.edu.cn/simple干脆編譯吧。首先。安裝好cuda130/cuda131、python3.10。后來看資料說python是3.10、3.11、3.12應該都可以。(vllm)[rootlocalhost vllm]# nvcc -Vnvcc: NVIDIA(R)Cuda compiler driver Copyright(c)2005-2025 NVIDIA Corporation Built on Wed_Aug_20_01:58:59_PM_PDT_2025 Cuda compilation tools, release13.0, V13.0.88 Build cuda_13.0.r13.0/compiler.36424714_0系統級依賴yuminstall-ygcc-c cmakemakegitninja-buildwget升級 Python 構建工具pipinstall--upgradepip setuptools wheelvllm 核心依賴pipinstalltransformers4.39.0 sentencepiece psutil py-cpuinfo ninja克隆 vllm 源碼gitclone https://github.com/vllm-project/vllm.gitcdvllm切換到 0.17.1 版本穩定適配 CUDA 13.xgitcheckout v0.17.1環境驗證importvllmimporttorch# 核心信息校驗print(fvllm 版本:{vllm.__version__})# 輸出 0.17.1print(fCUDA 可用:{torch.cuda.is_available()})# 輸出 Trueprint(fCUDA 版本:{torch.version.cuda})# 輸出 13.1兼容 13.0print(fnvcc 路徑:{torch.utils.cpp_extension.CUDA_HOME})# 輸出 /usr/local/cuda-13.0配置 CUDA 13.0 環境變量exportCUDA_HOME/usr/local/cuda-13.0exportPATH$CUDA_HOME/bin:$PATHexportLD_LIBRARY_PATH$CUDA_HOME/lib64:$LD_LIBRARY_PATH強制指定 CUDA 編譯器編譯并安裝CMAKE_ARGS-DCMAKE_CUDA_COMPILER${CUDA_HOME}/bin/nvcc -DLLAMA_CUBLASon\pipinstall.--no-cache-dir --force-reinstall等等就行了。8、更新版的vllm比如0.27.0如果安裝需要使用rust環境不然編譯版的會一直不通過安裝命令RUSTUP_DIST_SERVERhttps://mirrors.tuna.tsinghua.edu.cn/rustupcurl--protohttps--tlsv1.2-sSfhttps://sh.rustup.rs|sh9、rpm版nvidia-driver安裝例子當前使用時還要設置nouveau 開源驅動等一系列的事。rpm-ivhnvidia-driver-local-repo-rhel8-610.57.04-1.0-1.x86_64.rpm dnfinstall-ynvidia-driver10、rpm版cudnn安裝例子rpm-icudnn-local-repo-rhel8-9.23.2-1.0-1.x86_64.rpm#安裝cuda12的與你的cuda要配套dnf-yinstallcudnn9-cuda-12#安裝cuda13的版本與你的cuda要配套dnf-yinstallcudnn9-cuda-13