{"id":523,"date":"2025-03-14T16:59:18","date_gmt":"2025-03-14T08:59:18","guid":{"rendered":"https:\/\/blog.zhouhonghe.com\/?p=523"},"modified":"2025-10-22T12:00:31","modified_gmt":"2025-10-22T04:00:31","slug":"ubuntu-24-%e5%ae%89%e8%a3%85-%e6%98%be%e5%8d%a1%e9%a9%b1%e5%8a%a8cudacudnnvllm","status":"publish","type":"post","link":"https:\/\/blog.zhouhonghe.com\/?p=523","title":{"rendered":"Ubuntu 24 \u5b89\u88c5 \u663e\u5361\u9a71\u52a8+CUDA+vLLM"},"content":{"rendered":"<p># \u66f4\u65b0\u7cfb\u7edf<br \/>\n<code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/p>\n<p># \u5b89\u88c5\u57fa\u7840\u5f00\u53d1\u5de5\u5177<br \/>\n<code>sudo apt install -y build-essential gcc g++ make cmake unzip git wget curl htop<\/code><\/p>\n<p># \u5378\u8f7d\u81ea\u5e26\u7684\u9a71\u52a8<br \/>\n<code>sudo apt purge *nvidia*<\/code><\/p>\n<p># \u5b89\u88c5\u9a71\u52a8<br \/>\n<code>ubuntu-drivers devices<br \/>\nsudo apt install nvidia-driver-580-server<br \/>\nsudo reboot<\/code><\/p>\n<p># \u9a8c\u8bc1NVIDIA\u9a71\u52a8\u5b89\u88c5\u60c5\u51b5<br \/>\n<code>nvidia-smi<\/code><\/p>\n<p># \u5b89\u88c5CUDA https:\/\/developer.nvidia.com\/cuda-downloads<br \/>\n<code>wget wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/13.0.2\/local_installers\/cuda_13.0.2_580.95.05_linux.run<br \/>\nsudo sh cuda_13.0.2_580.95.05_linux.run<\/code><\/p>\n<p># \u5b89\u88c5UV<br \/>\n<code>curl -LsSf https:\/\/astral.sh\/uv\/install.sh | sh\u00a0<\/code><br \/>\n\uff08\u4e0b\u8f7d\u5f88\u6162\uff0c\u53ef\u80fd\u9700\u8981\u597d\u51e0\u5206\u949f\uff09<\/p>\n<p># \u4fee\u6539UV\u56fd\u5185\u6e90<code><br \/>\necho 'export UV_INDEX_URL=https:\/\/mirrors.aliyun.com\/pypi\/simple\/' &gt;&gt; ~\/.bashrc<br \/>\nsource ~\/.bashrc<\/code><\/p>\n<p># \u5b89\u88c5vLLM<\/p>\n<p><code>mkdir ~\/.venv<br \/>\ncd .venv<br \/>\nuv venv vllm<br \/>\nsource vllm\/bin\/activate<br \/>\nuv pip install vllm<\/code><\/p>\n<p># \u5b89\u88c5modelscope\u5e76\u4e0b\u8f7d\u6a21\u578b<br \/>\n<code>uv pip install modelscope<br \/>\nmodelscope download --model Qwen\/Qwen3-32B --local_dir \/data\/vllm\/models\/Qwen3-32B<\/code><\/p>\n<p># \u542f\u52a8vLLM<br \/>\n<code>CUDA_VISIBLE_DEVICES=0,1 vllm serve \/data\/vllm\/models\/Qwen3-32B --tensor-parallel-size 2 --api-key \"YOUR_API_KEY\" --max-model-len 16384 --port 8000<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p># \u66f4\u65b0\u7cfb\u7edf sudo apt update &amp;&amp; sudo apt upgrade -y # [&hellip;]<\/p>... ","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-523","post","type-post","status-publish","format-standard","hentry","category-others"],"_links":{"self":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=523"}],"version-history":[{"count":10,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":573,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions\/573"}],"wp:attachment":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}