{"id":186,"date":"2025-12-24T23:22:11","date_gmt":"2025-12-24T15:22:11","guid":{"rendered":"https:\/\/zgc.91svip.icu\/?p=186"},"modified":"2026-01-03T14:44:42","modified_gmt":"2026-01-03T06:44:42","slug":"pythonenv","status":"publish","type":"post","link":"https:\/\/zgc.91svip.icu\/index.php\/pythonenv\/","title":{"rendered":"python\u73af\u5883\u914d\u7f6e\u2014\u2014\u6df1\u5ea6\u5b66\u4e60(GPU,CUDA\u4e0ecuDNN\u7684\u5173\u7cfb\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u524d\u8a00<\/h2>\n\n\n\n<p>\u6700\u8fd1\u770b\u4e86\u5218\u4e8c\u5927\u4eba\u7684\u6df1\u5ea6\u5b66\u4e60\u8bfe\u7a0b\uff0c\u53c8\u71c3\u8d77\u5b66\u4e60\u7684\u5174\u8da3\uff0c\u6240\u4ee5\u6211\u5c31\u60f3\u7740\u91cd\u65b0\u4ece\u5934\u914d\u7f6e\u4e00\u4e0bpython\u7684\u73af\u5883\uff0c\u56e0\u4e3a\u4e4b\u524d\u5b66\u7684\u65f6\u5019\u5c31\u662f\u4e00\u77e5\u534a\u89e3\u7684\u3002\u987a\u4fbf\u628acuda\uff0ccudnn\u548canaconda\u4e5f\u7ed9\u5f04\u6e05\u695a\u3002\u53e6\u5916\u8bf4\u4e00\u4e0b\u5218\u4e8c\u5927\u4eba\u6df1\u5ea6\u5b66\u4e60\u8bfe\u7a0b\u8bb2\u7684\u662f\u771f\u7684\u597d\u5462\uff0c\u5927\u5bb6\u5982\u679c\u60f3\u5b66\u6df1\u5ea6\u5b66\u4e60\u7684\u53ef\u4ee5\u53bb\u770b\u770b\u3002<\/p>\n\n\n\n<p>\u3010\u300aPyTorch\u6df1\u5ea6\u5b66\u4e60\u5b9e\u8df5\u300b\u5b8c\u7ed3\u5408\u96c6\u3011 <a href=\"https:\/\/www.bilibili.com\/video\/BV1Y7411d7Ys\/?share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65\">https:\/\/www.bilibili.com\/video\/BV1Y7411d7Ys\/?share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u539f\u7406<\/h2>\n\n\n\n<p>\u56e0\u4e3a\u5b66\u4e60\u6df1\u5ea6\u5b66\u4e60\u80af\u5b9a\u7ed5\u4e0d\u5f00\u82f1\u4f1f\u8fbe\u7684\u663e\u5361\u52a0\u901f\u7684\uff0c\u8981CUDA\u6765\u8c03\u7528GPU\u6765\u52a0\u901f\u8bad\u7ec3\u3002\u6240\u4ee5\u5f04\u6e05\u695aGPU,CUDA\u4e0ecuDNN\u7684\u5173\u7cfb\u6709\u5229\u4e8e\u6211\u4eec\u5b66\u4e60\u6df1\u5ea6\u5b66\u4e60\u5462\uff0c\u4e0d\u7136\u6bcf\u6b21\u90fd\u4e91\u91cc\u96fe\u91cc\uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6ca1\u7528\u5230GPU\u52a0\u901f\u5462\ud83e\udd23\u3002\u6211\u53c2\u8003\u4e0b\u9762\u8fd9\u4e2a\u89c6\u9891\u6765\u8fdb\u884c\u8bb2\u89e3\u3002<\/p>\n\n\n\n<p>\u3010\u3010PyTorch\u3011B\u7ad9\u9996\u4e2a\uff0c\u7ec8\u4e8e\u6709\u4eba\u628a GPU\/ CUDA\/ cuDNN \u8bb2\u6e05\u695a\u4e86\u3011 <a href=\"https:\/\/www.bilibili.com\/video\/BV15Q4y1i7Bp\/?p=2&amp;share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65\">https:\/\/www.bilibili.com\/video\/BV15Q4y1i7Bp\/?p=2&amp;share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65<\/a><\/p>\n\n\n\n<p>\u5927\u5bb6\u4e5f\u53ef\u4ee5\u770b\u770b\u8fd9\u4e2a\u89c6\u9891\u6765\u4e86\u89e3\u7684CUDA\u7684\u53d1\u5c55\u5386\u7a0b\u3002<\/p>\n\n\n\n<p>\u3010\u4e00\u6587\u8bb2\u6e05\u695aCUDA\u3011 <a href=\"https:\/\/www.bilibili.com\/video\/BV1n1yfYpEQA\/?share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65\">https:\/\/www.bilibili.com\/video\/BV1n1yfYpEQA\/?share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e00\u4e2a\u95ee\u9898\uff1a\u4e3a\u4ec0\u4e48\u6df1\u5ea6\u5b66\u4e60\u8981\u7528\u5230GPU<\/h3>\n\n\n\n<p>\u8fd9\u4e2a\u5c31\u662f\u56e0\u4e3aGPU\u7684<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u5e76\u884c<\/mark>\u8ba1\u7b97\u67b6\u6784\u975e\u5e38\u9002\u914d\u6df1\u5ea6\u5b66\u4e60\u4e2d\u7684<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u77e9\u9635<\/mark>\u8fd0\u7b97\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u5927\u5e45\u63d0\u5347\u8bad\u7ec3\u548c\u63a8\u7406\u7684\u6548\u7387\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u5728\u5b66\u4e60\u6df1\u5ea6\u5b66\u4e60\u7684\u65f6\u5019\u901a\u8fc7GPU\u6765\u52a0\u901f\u8bad\u7ec3\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e8c\u4e2a\u95ee\u9898\uff1a\u5f53\u7535\u8111\u63a5\u53d7\u5230\u6211\u4eec\u5199\u7684\u4ee3\u7801\u77e5\u9053\u8981\u8c03\u7528GPU\u65f6\uff0c\u7535\u8111\u5b9e\u9645\u662f\u600e\u4e48\u5b8c\u6210\u8fd9\u4e2a\u8fc7\u7a0b\u7684<\/h3>\n\n\n\n<p>GPU \u662f\u663e\u5361\u4e2d\u7684\u6838\u5fc3\u8ba1\u7b97\u90e8\u4ef6\uff0c\u6700\u521d\u4e3b\u8981\u7528\u4e8e\u56fe\u5f62\u6e32\u67d3\u3002\u7531\u4e8e\u5176\u5185\u90e8\u7531\u5927\u91cf\u8ba1\u7b97\u5355\u5143\u7ec4\u6210\uff0c\u7ed3\u6784\u4e0a\u5929\u7136\u9002\u5408\u6267\u884c\u5927\u89c4\u6a21\u5e76\u884c\u8ba1\u7b97\u3002\u968f\u7740\u79d1\u5b66\u8ba1\u7b97\u3001\u6df1\u5ea6\u5b66\u4e60\u7b49\u9886\u57df\u7684\u53d1\u5c55\uff0c\u4eba\u4eec\u9010\u6e10\u5e0c\u671b\u5229\u7528 GPU \u6765\u5206\u62c5 CPU \u5728\u6570\u503c\u8ba1\u7b97\u65b9\u9762\u7684\u538b\u529b\uff0c\u4ee5\u63d0\u5347\u6574\u4f53\u8ba1\u7b97\u6548\u7387\u3002<\/p>\n\n\n\n<p>\u7136\u800c\uff0cGPU \u5e76\u4e0d\u80fd\u50cf CPU \u4e00\u6837\u88ab\u64cd\u4f5c\u7cfb\u7edf\u76f4\u63a5\u5f53\u4f5c\u901a\u7528\u8ba1\u7b97\u5355\u5143\u6765\u8c03\u5ea6\u3002CPU \u5177\u6709\u5b8c\u6574\u7684\u63a7\u5236\u903b\u8f91\u548c\u590d\u6742\u7684\u6307\u4ee4\u7cfb\u7edf\uff0c\u800c GPU \u66f4\u64c5\u957f\u6267\u884c\u9ad8\u5ea6\u5e76\u884c\u3001\u7ed3\u6784\u76f8\u540c\u7684\u8ba1\u7b97\u4efb\u52a1\u3002\u56e0\u6b64\uff0c\u8981\u8ba9\u7a0b\u5e8f\u201c\u7528\u5f97\u4e0a\u201dGPU\uff0c\u5c31\u9700\u8981\u4e00\u5957\u4e13\u95e8\u7684\u8f6f\u4ef6\u673a\u5236\u6765\u5b8c\u6210 GPU \u7684\u7ba1\u7406\u3001\u8c03\u5ea6\u548c\u8ba1\u7b97\u4efb\u52a1\u7684\u4e0b\u53d1\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff0cNVIDIA \u63a8\u51fa\u4e86 CUDA\uff08Compute Unified Device Architecture\uff09\u5e73\u53f0\u3002CUDA \u672c\u8d28\u4e0a\u662f\u4e00\u5957\u9762\u5411 GPU \u7684\u5e76\u884c\u8ba1\u7b97\u7f16\u7a0b\u6a21\u578b\u548c\u8fd0\u884c\u65f6\u7cfb\u7edf\uff0c\u5b83\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u79cd\u89c4\u8303\u5316\u7684\u65b9\u5f0f\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u53ef\u4ee5\u5728 CPU \u7684\u63a7\u5236\u4e0b\uff0c\u53ef\u4ee5\u5c06\u8ba1\u7b97\u4efb\u52a1\u4ea4\u7531 GPU \u6267\u884c\u3002<\/p>\n\n\n\n<p>CUDA \u901a\u8fc7\u5f15\u5165 kernel\uff08\u5185\u6838\uff09\u3001thread\uff08\u7ebf\u7a0b\uff09\u548c block\uff08\u7ebf\u7a0b\u5757\uff09\u7b49\u6982\u5ff5\uff0c\u5c06\u539f\u672c\u5728 CPU \u4e0a\u4e32\u884c\u6267\u884c\u7684\u8ba1\u7b97\u4efb\u52a1\u62c6\u5206\u4e3a\u5927\u91cf\u76f8\u4e92\u72ec\u7acb\u7684\u5b50\u4efb\u52a1\uff0c\u5e76\u7531 GPU \u4e2d\u6210\u767e\u4e0a\u5343\u4e2a\u7ebf\u7a0b\u5e76\u884c\u6267\u884c\uff0c\u4ece\u800c\u663e\u8457\u63d0\u5347\u8ba1\u7b97\u6548\u7387\u3002<\/p>\n\n\n\n<p>CUDA \u7684\u5e95\u5c42\u63a5\u53e3\u548c\u8fd0\u884c\u65f6\u5e93\u4e3b\u8981\u7531 C\/C++ \u5b9e\u73b0\u3002\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u7b80\u5355\u7684 CUDA \u793a\u4f8b\u7a0b\u5e8f\uff0c\u5176\u529f\u80fd\u662f\u4f7f\u7528 GPU \u5e76\u884c\u5730\u5b8c\u6210\u4e24\u4e2a\u957f\u5ea6\u4e3a 1024 \u7684\u5411\u91cf\u76f8\u52a0\uff0c\u5e76\u5c06\u8ba1\u7b97\u7ed3\u679c\u62f7\u8d1d\u56de CPU \u7aef\u8fdb\u884c\u9a8c\u8bc1\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cCUDA \u7a0b\u5e8f\u6587\u4ef6\u7684\u540e\u7f00\u901a\u5e38\u4e3a <code>.cu<\/code>\uff0c\u5e76\u4e14\u9700\u8981\u4f7f\u7528 NVIDIA \u63d0\u4f9b\u7684 <code>nvcc<\/code> \u7f16\u8bd1\u5668\u8fdb\u884c\u7f16\u8bd1\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include \"cuda_runtime.h\"\n#include &lt;stdlib.h&gt;\n#include &lt;assert.h&gt;\n#include &lt;iostream&gt;\n\n\/\/ Device code\uff08\u8fd0\u884c\u5728 GPU \u4e0a\uff09\n__global__ void VecAdd(float* A, float* B, float* C)\n{\n    int i = threadIdx.x;\n    C&#91;i] = A&#91;i] + B&#91;i];\n}\n\n\/\/ Host code\uff08\u8fd0\u884c\u5728 CPU \u4e0a\uff09\nint main()\n{\n    int N = 1024;\n    size_t size = N * sizeof(float);\n\n    \/\/ Allocate input vectors h_A and h_B in host memory\n    float* h_A = (float*)malloc(size);\n    float* h_B = (float*)malloc(size);\n    float* h_C = (float*)malloc(size);\n\n    \/\/ Initialize input vectors\n    for (size_t i = 0; i &lt; N; i++) {\n        h_A&#91;i] = 1.0f;\n        h_B&#91;i] = 2.0f;\n    }\n\n    \/\/ Allocate vectors in device memory\n    float* d_A;\n    cudaMalloc(&amp;d_A, size);\n    float* d_B;\n    cudaMalloc(&amp;d_B, size);\n    float* d_C;\n    cudaMalloc(&amp;d_C, size);\n\n    \/\/ Copy vectors from host memory to device memory\n    cudaMemcpy(d_A, h_A, size, cudaMemcpyHostToDevice);\n    cudaMemcpy(d_B, h_B, size, cudaMemcpyHostToDevice);\n\n    \/\/ Kernel invocation with N threads\n    VecAdd&lt;&lt;&lt;1, N&gt;&gt;&gt;(d_A, d_B, d_C);\n\n    \/\/ Copy result from device memory to host memory\n    \/\/ h_C contains the result in host memory\n    cudaMemcpy(h_C, d_C, size, cudaMemcpyDeviceToHost);\n\n    for (size_t i = 0; i &lt; N; i++) {\n        assert(h_C&#91;i] == 3.0f);\n    }\n\n    std::cout &lt;&lt; \"\\t\\t\\tDONE!\" &lt;&lt; std::endl;\n\n    \/\/ Free device memory\n    cudaFree(d_A);\n    cudaFree(d_B);\n    cudaFree(d_C);\n\n    \/\/ Free host memory\n    free(h_A);\n    free(h_B);\n    free(h_C);\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">main \u51fd\u6570\u529f\u80fd\u6982\u8ff0<\/h4>\n\n\n\n<p>\u4ece\u6574\u4f53\u6d41\u7a0b\u6765\u770b\uff0c<code>main<\/code> \u51fd\u6570\u4e3b\u8981\u5b8c\u6210\u4e86\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728 Host\uff08CPU\uff09\u7aef\u7533\u8bf7\u5e76\u521d\u59cb\u5316\u6570\u636e<\/li>\n\n\n\n<li>\u5c06 Host \u7aef\u7684\u6570\u636e\u663e\u5f0f\u62f7\u8d1d\u5230 Device\uff08GPU\uff09\u7aef\u663e\u5b58<\/li>\n\n\n\n<li>\u901a\u8fc7 CUDA kernel \u542f\u52a8 GPU \u5e76\u884c\u8ba1\u7b97<\/li>\n\n\n\n<li>\u5c06 Device \u7aef\u7684\u8ba1\u7b97\u7ed3\u679c\u62f7\u8d1d\u56de Host \u7aef\u8fdb\u884c\u9a8c\u8bc1<\/li>\n<\/ol>\n\n\n\n<p>\u8fd9\u662f\u4e00\u4e2a\u6700\u57fa\u7840\u7684 CUDA \u4f7f\u7528\u793a\u4f8b\uff0c\u7528\u4e8e\u5c55\u793a CPU \u5982\u4f55\u901a\u8fc7 CUDA \u8c03\u7528 GPU \u5b8c\u6210\u5e76\u884c\u8ba1\u7b97\u4efb\u52a1\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8865\u5145\u8bf4\u660e\u4e0e\u603b\u7ed3<\/h4>\n\n\n\n<p>\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u4e0a\u8ff0\u793a\u4f8b\u4e2d\u4ec5\u4f7f\u7528\u4e86\u6700\u7b80\u5355\u7684\u7ebf\u7a0b\u914d\u7f6e\u65b9\u5f0f\uff0c\u5b9e\u9645\u7684 CUDA \u7a0b\u5e8f\u4e2d\u901a\u5e38\u8fd8\u4f1a\u5f15\u5165 grid\uff08\u7f51\u683c\uff09\u3001\u591a\u7ef4 block \u7b49\u66f4\u590d\u6742\u7684\u7ec4\u7ec7\u7ed3\u6784\uff0c\u4ee5\u9002\u5e94\u66f4\u5927\u89c4\u6a21\u548c\u66f4\u590d\u6742\u7684\u8ba1\u7b97\u9700\u6c42\u3002\u4f46\u662f\u6211\u4eec\u53ea\u9700\u8981\u7406\u89e3 CUDA \u7684\u57fa\u672c\u5de5\u4f5c\u539f\u7406\u5c31\u53ef\u4ee5\u4e86\uff0c\u5e76\u4e0d\u9700\u8981\u6df1\u5165\u638c\u63e1\u6240\u6709 CUDA \u7f16\u7a0b\u7ec6\u8282\u3002<\/p>\n\n\n\n<p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u7406\u89e3\u4ee5\u4e0b\u5206\u5de5\u5173\u7cfb\u5373\u53ef\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">CPU\uff1a\u8d1f\u8d23\u7a0b\u5e8f\u63a7\u5236\u3001\u4efb\u52a1\u8c03\u5ea6\u548c\u903b\u8f91\u7ba1\u7406<\/mark><\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">CUDA\uff1a\u4f5c\u4e3a CPU \u4e0e GPU \u4e4b\u95f4\u7684\u6865\u6881\uff0c\u8d1f\u8d23\u5185\u5b58\u7ba1\u7406\u3001\u4efb\u52a1\u4e0b\u53d1\u548c\u8fd0\u884c\u65f6\u652f\u6301<\/mark><\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">GPU\uff1a\u8d1f\u8d23\u6267\u884c\u5927\u89c4\u6a21\u5e76\u884c\u8ba1\u7b97\u4efb\u52a1<\/mark><\/li>\n<\/ul>\n\n\n\n<p>\u56e0\u6b64\uff0cCUDA \u63d0\u4f9b\u7684\u5e76\u4e0d\u662f\u4e00\u79cd\u201c\u81ea\u52a8\u52a0\u901f\u201d\u7684\u9ed1\u76d2\u5de5\u5177\uff0c\u800c\u662f\u4e00\u5957\u5b8c\u6574\u7684\u5e76\u884c\u8ba1\u7b97\u7f16\u7a0b\u89c4\u8303\u548c\u8fd0\u884c\u73af\u5883\u3002\u5b83\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u5c06\u590d\u6742\u8ba1\u7b97\u95ee\u9898\u62c6\u5206\u4e3a\u5927\u91cf\u53ef\u5e76\u884c\u6267\u884c\u7684\u5b50\u4efb\u52a1\uff0c\u5e76\u5145\u5206\u5229\u7528 GPU \u7684\u5e76\u884c\u8ba1\u7b97\u80fd\u529b\uff0c\u4ece\u800c\u5728\u79d1\u5b66\u8ba1\u7b97\u3001\u56fe\u50cf\u5904\u7406\u548c\u6df1\u5ea6\u5b66\u4e60\u7b49\u9886\u57df\u663e\u8457\u63d0\u5347\u8ba1\u7b97\u6548\u7387\u3002<\/p>\n\n\n\n<p>\u6700\u540e\u8bf4\u4e00\u4e0bCUDA \u63d0\u4f9b\u7684\u5e76\u4e0d\u662f\u5355\u7eaf\u7684\u201c\u52a0\u901f\u529f\u80fd\u201d\uff0c\u800c\u662f\u4e00\u5957\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u9ad8\u6548\u5229\u7528 GPU \u5e76\u884c\u80fd\u529b\u7684\u7f16\u7a0b\u89c4\u8303\u548c\u8fd0\u884c\u73af\u5883\uff0c\u4f7f\u5f97\u590d\u6742\u8ba1\u7b97\u53ef\u4ee5\u88ab\u62c6\u5206\u6210\u5927\u91cf\u5b50\u4efb\u52a1\uff0c\u5e76\u5728 GPU \u4e0a\u540c\u65f6\u6267\u884c\uff0c\u4ece\u800c\u663e\u8457\u63d0\u5347\u8ba1\u7b97\u6548\u7387\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e09\u4e2a\u95ee\u9898\uff1aCUDA\u3001CUDA Toolkit \u4e0e cuDNN \u662f\u4ec0\u4e48\u5173\u7cfb\uff1f<\/h3>\n\n\n\n<p>\u901a\u8fc7\u524d\u9762\u7684\u8bb2\u8ff0\uff0c\u6211\u4eec\u5df2\u7ecf\u5927\u81f4\u7406\u89e3\u4e86 CUDA \u662f\u4ec0\u4e48\u3002\u90a3\u4e48\uff0cCUDA Toolkit \u53c8\u626e\u6f14\u7740\u600e\u6837\u7684\u89d2\u8272\u5462\uff1f<\/p>\n\n\n\n<p>CUDA Toolkit \u7684\u4f5c\u7528\uff0c\u662f\u4e3a CUDA \u63d0\u4f9b\u5176\u6240\u9700\u7684\u4e00\u6574\u5957\u5f00\u53d1\u5de5\u5177\u548c\u8fd0\u884c\u73af\u5883\u3002\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0cCUDA Toolkit \u5e76\u4e0d\u662f\u67d0\u4e00\u4e2a\u5355\u72ec\u7684\u7a0b\u5e8f\uff0c\u800c\u662f NVIDIA \u63d0\u4f9b\u7684\u4e00\u6574\u5957 CUDA \u5f00\u53d1\u4e0e\u8fd0\u884c\u73af\u5883\uff0c\u5176\u4e2d\u5305\u542b\u4e86 CUDA \u7f16\u8bd1\u5668\uff08nvcc\uff09\u3001CUDA \u8fd0\u884c\u65f6\u5e93\u3001\u76f8\u5173\u5934\u6587\u4ef6\uff0c\u4ee5\u53ca\u8c03\u8bd5\u4e0e\u6027\u80fd\u5206\u6790\u7b49\u914d\u5957\u5de5\u5177\u3002\u7b80\u5355\u6765\u8bf4\uff0cCUDA Toolkit \u53ef\u4ee5\u7406\u89e3\u4e3a CUDA \u5728\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u201c\u5b9e\u4f53\u5316\u5b9e\u73b0\u201d\uff0c\u6ca1\u6709\u5b83\uff0cCUDA \u7a0b\u5e8f\u65e2\u65e0\u6cd5\u88ab\u7f16\u8bd1\uff0c\u4e5f\u65e0\u6cd5\u5728\u7cfb\u7edf\u4e2d\u6b63\u5e38\u8fd0\u884c\u3002\u56e0\u6b64\uff0c\u5728\u5b9e\u9645\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u4ece NVIDIA \u5b98\u7f51\u4e0b\u8f7d\u7684\uff0c\u901a\u5e38\u5c31\u662f\u67d0\u4e00\u7248\u672c\u7684 CUDA Toolkit\u3002<\/p>\n\n\n\n<p>\u5728\u6b64\u57fa\u7840\u4e4b\u4e0a\uff0cNVIDIA \u53c8\u9488\u5bf9\u6df1\u5ea6\u5b66\u4e60\u8fd9\u4e00\u5178\u578b\u5e94\u7528\u573a\u666f\u63a8\u51fa\u4e86 cuDNN\u3002cuDNN \u662f\u4e00\u4e2a\u6784\u5efa\u5728 CUDA \u4e4b\u4e0a\u7684\u9ad8\u6027\u80fd\u8ba1\u7b97\u5e93\uff0c\u4e13\u95e8\u5bf9\u6df1\u5ea6\u5b66\u4e60\u4e2d\u5e38\u89c1\u4e14\u8ba1\u7b97\u5bc6\u96c6\u7684\u64cd\u4f5c\uff08\u5982\u5377\u79ef\u3001\u6c60\u5316\u3001\u6fc0\u6d3b\u51fd\u6570\u3001Batch Normalization \u7b49\uff09\u8fdb\u884c\u4e86\u9ad8\u5ea6\u4f18\u5316\u3002cuDNN \u672c\u8eab\u5e76\u4e0d\u5f15\u5165\u65b0\u7684\u7f16\u7a0b\u6a21\u578b\uff0c\u800c\u662f\u76f4\u63a5\u590d\u7528 CUDA \u63d0\u4f9b\u7684\u5e76\u884c\u8ba1\u7b97\u80fd\u529b\uff0c\u53ea\u662f\u5c06\u590d\u6742\u4e14\u6027\u80fd\u654f\u611f\u7684 CUDA \u5b9e\u73b0\u5c01\u88c5\u6210\u4e86\u66f4\u6613\u4e8e\u8c03\u7528\u7684\u63a5\u53e3\u3002<\/p>\n\n\n\n<p>\u4ece\u4f9d\u8d56\u5173\u7cfb\u4e0a\u6765\u770b\uff0ccuDNN \u5fc5\u987b\u8fd0\u884c\u5728 CUDA \u4e4b\u4e0a\uff0c\u800c CUDA \u7684\u6b63\u5e38\u4f7f\u7528\u53c8\u4f9d\u8d56 CUDA Toolkit \u6240\u63d0\u4f9b\u7684\u7f16\u8bd1\u5668\u548c\u8fd0\u884c\u65f6\u73af\u5883\u3002\u56e0\u6b64\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\uff1a<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">CUDA \u5b9a\u4e49\u4e86 GPU \u5e76\u884c\u8ba1\u7b97\u7684\u6838\u5fc3\u6a21\u578b\uff0cCUDA Toolkit \u63d0\u4f9b\u4e86\u8fd9\u4e00\u6a21\u578b\u5728\u7cfb\u7edf\u4e2d\u7684\u5b9e\u73b0\u4e0e\u8fd0\u884c\u57fa\u7840\uff0c\u800c cuDNN \u5219\u662f\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u9762\u5411\u6df1\u5ea6\u5b66\u4e60\u573a\u666f\u63d0\u4f9b\u7684\u4e13\u4e1a\u9ad8\u6027\u80fd\u52a0\u901f\u5e93\u3002<\/mark><\/p>\n\n\n\n<p>\u603b\u4f53\u800c\u8a00\uff0cCUDA\u3001CUDA Toolkit \u4e0e cuDNN \u5e76\u4e0d\u662f\u5e76\u5217\u7684\u6982\u5ff5\uff0c\u800c\u662f\u81ea\u5e95\u5411\u4e0a\u7684\u5c42\u7ea7\u5173\u7cfb\u3002\u7406\u89e3\u5b83\u4eec\u4e4b\u95f4\u7684\u5206\u5de5\u4e0e\u4f9d\u8d56\u5173\u7cfb\uff0c\u6709\u52a9\u4e8e\u66f4\u6e05\u695a\u5730\u8ba4\u8bc6 GPU \u52a0\u901f\u4f53\u7cfb\u5728\u5b9e\u9645\u5de5\u7a0b\u4e2d\u7684\u8fd0\u884c\u65b9\u5f0f\u3002<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u4e5f\u6b63\u56e0\u5982\u6b64\uff0c\u5728\u5b9e\u9645\u5b89\u88c5\u548c\u914d\u7f6e\u73af\u5883\u65f6\uff0c\u9700\u8981\u7279\u522b\u6ce8\u610f CUDA Toolkit \u4e0e cuDNN \u4e4b\u95f4\u7684\u7248\u672c\u5bf9\u5e94\u5173\u7cfb\uff0c\u907f\u514d\u7531\u4e8e\u7248\u672c\u4e0d\u5339\u914d\u800c\u5bfc\u81f4 GPU \u65e0\u6cd5\u6b63\u5e38\u4f7f\u7528\u3002<\/mark><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u56db\u4e2a\u95ee\u9898\uff1a\u65e2\u7136 CUDA \u662f\u7528 C\/C++ \u5b9e\u73b0\u7684\uff0c\u4e3a\u4ec0\u4e48\u6211\u4eec\u7528 Python \u4e5f\u80fd\u8c03\u7528 GPU \u8fdb\u884c\u52a0\u901f\uff1f<\/h3>\n\n\n\n<p>\u5728\u524d\u9762\u7684\u5185\u5bb9\u4e2d\u6211\u4eec\u63d0\u5230\uff0cCUDA \u53ca\u5176\u76f8\u5173\u7ec4\u4ef6\u4e3b\u8981\u662f\u7531 C\/C++ \u5b9e\u73b0\u7684\u3002\u90a3\u4e48\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c\u5c24\u5176\u662f\u5728\u6df1\u5ea6\u5b66\u4e60\u573a\u666f\u4e0b\uff0c\u6211\u4eec\u5f80\u5f80\u7f16\u5199\u7684\u662f Python \u4ee3\u7801\uff0c\u5374\u540c\u6837\u80fd\u591f\u8c03\u7528 GPU \u5e76\u83b7\u5f97\u663e\u8457\u7684\u52a0\u901f\u6548\u679c\uff0c\u8fd9\u80cc\u540e\u7684\u539f\u56e0\u662f\u4ec0\u4e48\u5462\uff1f<\/p>\n\n\n\n<p>\u5173\u952e\u5728\u4e8e\uff1a<strong>Python \u672c\u8eab\u5e76\u4e0d\u76f4\u63a5\u4e0e GPU \u8fdb\u884c\u8ba1\u7b97\uff0c\u800c\u662f\u901a\u8fc7<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6<\/mark>\u95f4\u63a5\u8c03\u7528\u4e86\u5e95\u5c42\u57fa\u4e8e CUDA \u7684\u9ad8\u6027\u80fd\u5b9e\u73b0\u3002<\/strong><\/p>\n\n\n\n<p>\u4ee5 PyTorch \u4e3a\u4f8b\uff0cPyTorch \u5e76\u4e0d\u662f GPU \u8ba1\u7b97\u80fd\u529b\u7684\u6765\u6e90\uff0c\u800c\u662f\u5bf9 CUDA \u751f\u6001\u7684\u4e00\u6b21<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u9ad8\u5c42\u5c01\u88c5<\/mark>\u3002PyTorch \u7684\u5e95\u5c42\u6838\u5fc3\u7531 C\/C++ \u7f16\u5199\uff0c\u5e76\u901a\u8fc7 CUDA\u3001cuDNN \u7b49\u5e93\u5b9e\u73b0\u4e86 GPU \u4e0a\u7684\u9ad8\u6548\u8ba1\u7b97\u903b\u8f91\uff1b\u800c Python \u53ea\u662f\u4f5c\u4e3a\u201c\u63a5\u53e3\u5c42\u201d\uff0c\u7528\u4e8e\u63cf\u8ff0\u8ba1\u7b97\u8fc7\u7a0b\u3001\u7ec4\u7ec7\u6a21\u578b\u7ed3\u6784\u548c\u8c03\u5ea6\u8ba1\u7b97\u6d41\u7a0b\u3002\u771f\u6b63\u8fd0\u884c\u5728 GPU \u4e0a\u7684\u6570\u503c\u8ba1\u7b97\uff0c\u4f9d\u7136\u53d1\u751f\u5728 CUDA kernel \u5c42\u3002<\/p>\n\n\n\n<p>\u5f53\u6211\u4eec\u5728 Python \u4e2d\u4f7f\u7528 PyTorch \u7f16\u5199\u4ee3\u7801\u65f6\uff0c\u5b9e\u9645\u4e0a\u505a\u7684\u662f\u544a\u8bc9 PyTorch\u201c\u8981\u505a\u4ec0\u4e48\u8ba1\u7b97\u201d\uff0c\u800c\u4e0d\u662f\u201c\u5982\u4f55\u5728 GPU \u4e0a\u4e00\u6b65\u6b65\u8ba1\u7b97\u201d\u3002PyTorch \u4f1a\u5728\u5185\u90e8\u5224\u65ad\u5f53\u524d\u662f\u5426\u5b58\u5728\u53ef\u7528\u7684 GPU \u73af\u5883\uff0c\u5982\u679c\u5b58\u5728\uff0c\u5c31\u4f1a\u5c06\u76f8\u5e94\u7684\u8ba1\u7b97\u64cd\u4f5c\u6620\u5c04\u4e3a\u5bf9 CUDA \u6216 cuDNN \u7684\u8c03\u7528\uff0c\u5e76\u6700\u7ec8\u5728 GPU \u4e0a\u5e76\u884c\u6267\u884c\u3002<\/p>\n\n\n\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c<strong>Python \u5e76\u6ca1\u6709\u7ed5\u8fc7 CUDA\uff0c\u4e5f\u6ca1\u6709\u76f4\u63a5\u63a7\u5236 GPU\uff0c\u800c\u662f\u7ad9\u5728 PyTorch \u8fd9\u6837\u7684\u6846\u67b6\u4e4b\u4e0a\uff0c\u95f4\u63a5\u4f7f\u7528\u4e86 CUDA \u63d0\u4f9b\u7684\u80fd\u529b\u3002<\/strong><\/p>\n\n\n\n<p>\u4e0b\u9762\u56fe\u7247\u4e2d\u7684\u5c55\u793a\u7684\u5c31\u662f\u5982\u4f55\u5c06\u6570\u636e\u62f7\u8d1d\u5230GPU\u4e0a\u548c\u5229\u7528GPU\u52a0\u901f\u6a21\u578b\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u56e0\u4e3a\u672c\u6587\u7ae0\u53ea\u662f\u4ecb\u7ecd\u4e00\u4e0b\u65b9\u6cd5\uff0c\u5177\u4f53\u7684\u6df1\u5ea6\u5b66\u4e60\u7684\u6574\u4e2a\u6d41\u7a0b\u8bf7\u5927\u5bb6\u770b\u770b\u5218\u4e8c\u5927\u4eba\u7684\u6df1\u5ea6\u5b66\u4e60\u8bfe\u7a0b\u5462\uff0c\u975e\u5e38\u5b9e\u7528\u3002\u5b66\u5230\u7b2c10\u8bfe\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08\u57fa\u7840\u7bc7\uff09\u7684\u65f6\u5019\u5728\u89c6\u9891\u7684\u6700\u6709\u6709\u8bb2\u5982\u4f55\u5229\u7528GPU\u8fdb\u884c\u6a21\u578b\u7684\u52a0\u901f\u3002<\/p>\n\n\n\n<p>\u3010\u300aPyTorch\u6df1\u5ea6\u5b66\u4e60\u5b9e\u8df5\u300b\u5b8c\u7ed3\u5408\u96c6\u3011 <a href=\"https:\/\/www.bilibili.com\/video\/BV1Y7411d7Ys\/?p=10&amp;share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65\">https:\/\/www.bilibili.com\/video\/BV1Y7411d7Ys\/?p=10&amp;share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-77-1024x687.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-221\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-77-1024x687.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-77-300x201.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-77-768x515.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-77-1536x1030.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-77-2048x1373.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-76-1024x687.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-76-1024x687.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-76-300x201.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-76-768x515.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-76-1536x1030.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-76-2048x1373.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u64cd<\/h2>\n\n\n\n<p>\u56e0\u4e3a\u662f\u4ece\u5934\u5f00\u59cb\u914d\u7f6epython\u73af\u5883\uff0c\u6240\u4ee5\u6211\u5c31\u6253\u7b97\u628aanaconda\u4e4b\u7c7b\u7684\u5168\u5220\u6389\u91cd\u65b0\u5b89\u88c5\u3002\u6211\u63a8\u8350\u4e00\u4e2a\u5378\u8f7d\u8f6f\u4ef6\u53eb\u505a<a href=\"https:\/\/geekuninstaller.com\/download?version=1.5.2.165\" data-type=\"link\" data-id=\"https:\/\/geekuninstaller.com\/download?version=1.5.2.165\">geek<\/a>\uff0c\u8fd9\u4e2a\u7684\u514d\u8d39\u7248\u5c31\u6709\u5f88\u5f3a\u7684\u529f\u80fd\uff0c\u5927\u5bb6\u53ef\u4ee5\u8bd5\u4e00\u8bd5\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-74-1024x695.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-217\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-74-1024x695.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-74-300x204.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-74-768x521.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-74-1536x1043.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-74-2048x1391.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u5b9e\u64cd\u65b9\u9762\u6211\u53c2\u8003\u4e86B\u7ad9\u7684\u8fd9\u4e2a\u6559\u7a0b\uff0c\u56e0\u4e3a\u4ed6\u5728\u5b89\u88c5\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5927\u81f4\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u505a\u3002<\/p>\n\n\n\n<p>\u3010\u901a\u5173cuda\u3001anaconda\u3001pytorch\u7684\u5b89\u88c5\uff08\u6df1\u5ea6\u5b66\u4e60\u5fc5\u5907\u57fa\u672c\u529f\uff09\u3011 <a href=\"https:\/\/www.bilibili.com\/video\/BV1dujdzrEJq\/?share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65\">https:\/\/www.bilibili.com\/video\/BV1dujdzrEJq\/?share_source=copy_web&amp;vd_source=fac6f9fc6ad59403bae7877047951d65<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u663e\u5361\u9a71\u52a8<\/h3>\n\n\n\n<p>\u9996\u5148\u5c31\u662f\u8981\u88c5\u82f1\u4f1f\u8fbe\u7684\u9a71\u52a8\u3002\u6ca1\u6709\u5b89\u88c5\u82f1\u4f1f\u8fbe\u9a71\u52a8\uff0c\u64cd\u4f5c\u7cfb\u7edf\u53ea\u80fd\u628a\u663e\u5361\u5f53\u4f5c\u201c\u901a\u7528\u663e\u793a\u8bbe\u5907\u201d\uff0c\u53ea\u6709\u5b89\u88c5\u4e86\u9a71\u52a8\uff0c\u7535\u8111\u624d\u771f\u6b63\u201c\u8ba4\u8bc6\u201d\u5e76\u80fd\u6b63\u786e\u4f7f\u7528\u82f1\u4f1f\u8fbe\u663e\u5361\u7684\u5168\u90e8\u80fd\u529b\u3002<\/p>\n\n\n\n<p>\u641c\u7d22\u82f1\u4f1f\u8fbe\uff0c\u70b9\u51fb\u9a71\u52a8\u7a0b\u5e8f\uff0c\u627e\u5230NVIDIA APP\u4e0b\u8f7d\u5c31\u53ef\u4ee5\u4e0b\u8f7d\u9a71\u52a8\u4e86\u3002\u9488\u5bf9\u4e8eGame Ready Driver\uff08\u6e38\u620f\u9a71\u52a8\uff09\u548cStudio Driver\uff08\u521b\u4f5c\u8005\u9a71\u52a8\uff09\u5176\u5b9e\u6ca1\u4ec0\u4e48\u592a\u5927\u533a\u522b\uff0c\u90fd\u53ef\u4ee5\u4e0b\u8f7d\u7684\uff0c\u4e3b\u8981\u533a\u522b\u5c31\u662fGame Ready Driver \u9762\u5411\u65b0\u6e38\u620f\u9996\u53d1\u548c\u6027\u80fd\u4f18\u5316\u3001\u66f4\u65b0\u5feb\u4f46\u7a33\u5b9a\u6027\u6b21\u4e4b\uff0c\u800c Studio Driver \u9762\u5411\u521b\u4f5c\u4e0e\u79d1\u7814\u573a\u666f\u3001\u66f4\u65b0\u6162\u4f46\u7ecf\u8fc7\u4e13\u4e1a\u8f6f\u4ef6\u5145\u5206\u9a8c\u8bc1\u3001\u7a33\u5b9a\u6027\u4f18\u5148\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-78-1024x510.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-222\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-78-1024x510.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-78-300x150.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-78-768x383.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-78-1536x765.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-78.png 1842w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-79-1024x521.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-223\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-79-1024x521.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-79-300x153.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-79-768x391.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-79-1536x782.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-79.png 1850w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-80-1024x535.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-224\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-80-1024x535.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-80-300x157.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-80-768x401.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-80-1536x802.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-80.png 1833w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u770b\u5230\u4e0b\u9762\u7684\u753b\u9762\u5c31\u8bf4\u660e\u4e0b\u597d\u4e86\uff0c<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-82-1024x742.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-226\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-82-1024x742.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-82-300x218.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-82-768x557.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-82.png 1295w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u53f3\u952e\u4f60\u7535\u8111\u5e95\u4e0b\u7684\u4efb\u52a1\u680f\uff0c\u6253\u5f00\u4efb\u52a1\u7ba1\u7406\u5668\u9009\u5230\u6027\u80fd\uff0c\u4f60\u770b\u5230NVIDIA\u7684\u663e\u5361\u5c31\u8bf4\u660e\u9a71\u52a8\u5b89\u88c5\u6b63\u786e\u4e86\u3002\u987a\u5e26\u8bf4\u4e00\u4e0b\u8fd9\u4e2aGPU0\u662fintel\u7684\u96c6\u6210\u663e\u5361\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-83-1024x623.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-227\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-83-1024x623.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-83-300x183.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-83-768x467.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-83.png 1440w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5miniconda<\/h3>\n\n\n\n<p>\u6211\u4e3a\u4ec0\u4e48\u9009\u62e9\u5b89\u88c5miniconda\uff0c\u662f\u56e0\u4e3aAnaconda \u81ea\u5e26\u5927\u91cf\u5e38\u7528\u79d1\u5b66\u8ba1\u7b97\u4e0e\u6df1\u5ea6\u5b66\u4e60\u5e93\u3001\u53ef\u4ee5\u505a\u5230\u5f00\u7bb1\u5373\u7528\u4f46\u4f53\u79ef\u5927\uff0c\u5e76\u4e14\u5f88\u591a\u7684\u4e1c\u897f\u6211\u4eec\u5728\u521a\u5f00\u59cb\u5b66\u662f\u7528\u4e0d\u4e0a\u7684\uff0c\u800c Miniconda \u53ea\u5305\u542b\u6700\u5c0f\u7684 conda \u4e0e Python\uff0c\u9700\u8981\u4ec0\u4e48\u518d\u81ea\u5df1\u5b89\u88c5\u3001\u4f53\u79ef\u5c0f\u4e14\u66f4\u7075\u6d3b\u3002\u6240\u4ee5\u9009\u7528miniconda\u3002<\/p>\n\n\n\n<p>\u7f51\u9875\u641c\u7d22miniconda\u5c31\u53ef\u4ee5\u4e86\uff0c\u6216\u8005\u6253\u5f00\u8fd9\u4e2a\u94fe\u63a5<a href=\"https:\/\/www.anaconda.com\/docs\/getting-started\/miniconda\/main\">Miniconda &#8211; Anaconda<\/a>\uff0cminiconda\u6709\u5f88\u591a\u7248\u672c\uff0c\u6211\u4eec\u70b9\u51fb<a href=\"https:\/\/repo.anaconda.com\/miniconda\">https:\/\/repo.anaconda.com\/miniconda<\/a>\u4e0b\u8f7d\u4ee5\u524d\u7684\u7248\u672c\u5462\uff0c\u592a\u65b0\u7684\u7248\u672c\u5f80\u5f80\u610f\u5473\u7740\u6709\u5f88\u591a\u4e0d\u7a33\u5b9a\u6027\ud83e\udd23\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-87-1024x536.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-232\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-87-1024x536.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-87-300x157.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-87-768x402.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-87-1536x804.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-87.png 1845w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u6211\u9009\u62e9\u4e0b\u8f7d\u8fd9\u4e2aminiconda-py39\u7684\u7248\u672c<a href=\"https:\/\/repo.anaconda.com\/miniconda\/Miniconda3-py39_25.9.1-3-Windows-x86_64.exe\">Miniconda3-py39_25.9.1-3-Windows-x86_64.exe<\/a>\uff0c\u56e0\u4e3a\u4ed6\u7684\u4fee\u6539\u65e5\u671f\u6bd4\u8f83\u6709\u610f\u601d\u3002\u5927\u5bb6\u53ef\u4ee5\u81ea\u5df1\u770b\u7740\u4e0b\u8f7d\uff0c\u90fd\u5dee\u4e0d\u591a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-88-1024x533.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-233\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-88-1024x533.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-88-300x156.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-88-768x400.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-88-1536x799.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-88.png 1856w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4e00\u76f4next\u5c31\u53ef\u4ee5\u4e86\uff0c\u8fd9\u91cc\u6ce8\u610f\u4e00\u4e0b\u9009\u62e9Just Me\uff0c\u53ef\u4ee5\u907f\u514d\u4e00\u4e9b\u95ee\u9898\u3002\u8fd9\u4e2a\u662fai\u7684\u89e3\u91ca<strong>\u4e00\u822c\u9009 Just Me<\/strong> \u2014\u2014 \u5b89\u88c5\u5728\u81ea\u5df1\u7528\u6237\u76ee\u5f55\u4e0b\uff0c\u4e0d\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\uff0c\u6700\u7a33\u59a5\u4e5f\u6700\u4e0d\u5bb9\u6613\u51fa\u6743\u9650\u548c\u73af\u5883\u51b2\u7a81\u95ee\u9898\uff1b\u53ea\u6709\u5728\u591a\u7528\u6237\u5171\u7528\u540c\u4e00\u53f0\u673a\u5668\u3001\u5e76\u4e14\u4f60\u660e\u786e\u9700\u8981\u6240\u6709\u8d26\u6237\u5171\u4eab conda \u65f6\uff0c\u624d\u9009 All Users\u3002<\/p>\n\n\n\n<p>\u89c6\u9891\u91cc\u9009\u4e86all users\uff0c\u6211\u611f\u89c9\u4e0d\u5bf9\u770b\u4e86\u5176\u4ed6\u89c6\u9891\u7136\u540e\u53c8\u95ee\u4e86ai\uff0c\u6240\u4ee5\u8fd9\u91cc\u9009just me\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-93.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-238\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-93.png 501w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-93-300x226.png 300w\" sizes=\"(max-width: 501px) 100vw, 501px\" \/><\/figure>\n\n\n\n<p>\u8bb0\u4e00\u4e0b\u4f60\u4e0b\u8f7d\u7684\u4f4d\u7f6e\u5462\uff0c\u65b9\u4fbf\u4ee5\u540e\u81ea\u5df1\u6765\u67e5\u770b\u3002\u6211\u559c\u6b22\u88c5\u5728\u5176\u4ed6\u76d8\u4e0a\uff0c\u770b\u4f60\u4eec\u81ea\u5df1\u5462\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-91.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-236\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-91.png 492w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-91-300x232.png 300w\" sizes=\"(max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u91cc\u5168\u9009\u5462\u3002\u9009\u4e86\u7b2c\u4e8c\u4e2a\u53ef\u4ee5\u5c06miniconda\u6dfb\u52a0Windows\u7684\u73af\u5883\u53d8\u91cf\u91cc\uff0c\u65b9\u4fbf\u6211\u4eec\u5728\u5728\u54ea\u91cc\u90fd\u53ef\u4ee5\u7528conda\u547d\u4ee4\u5462\uff0c\u6700\u540e\u70b9\u51fb\u5b89\u88c5\u5c31\u597d\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-94.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-239\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-94.png 495w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-94-300x231.png 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u6253\u5f00\u7ec8\u7aef\u8f93\u5165<code>conda env list<\/code>\u5c31\u53ef\u4ee5\u67e5\u770b\u6211\u4eec\u73b0\u5728\u53c8\u7684\u73af\u5883\u4e86\uff0c\u5982\u679c\u6211\u4eec\u5728\u4e0a\u4e00\u6b65\u6ca1\u52fe\u9009\u7b2c\u4e8c\u4e2a\u7684\u8bdd\uff0c\u8fd9\u91cc\u662f\u4e0d\u80fd\u76f4\u63a5\u5728\u7cfb\u7edf\u7ec8\u7aef\u91cc\u5b9e\u73b0conda\u547d\u4ee4\u7684\uff0c\u9700\u8981\u5728anaconda\u81ea\u5e26\u7684\u7ec8\u7aef\u91cc\u624d\u80fd\u7528\u5462\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-95-1024x576.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-240\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-95-1024x576.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-95-300x169.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-95-768x432.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-95.png 1112w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-96.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-241\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-96.png 573w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-96-300x53.png 300w\" sizes=\"(max-width: 573px) 100vw, 573px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5pytorch<\/h3>\n\n\n\n<p>\u5b89\u88c5CUDA\u6700\u91cd\u8981\u7684\u5c31\u662f\u7248\u672c\u5bf9\u5e94\uff0c\u4e0d\u7136\u4f1a\u6709\u4e71\u4e03\u516b\u7cdf\u7684\u95ee\u9898\u51fa\u73b0\u5462\uff0c\u5177\u4f53\u7684\u539f\u56e0\u6211\u5728\u4e0a\u9762\u7406\u8bba\u90e8\u5206\u7684\u7b2c\u4e09\u4e2a\u95ee\u9898\u56de\u7b54\u4e86\u5462\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u67e5\u770b\u4e00\u4e0b\u6211\u4eec\u7535\u8111\u6700\u9ad8\u80fd\u88c5\u591a\u5c11\u7248\u672c\u7684CUDA\uff0cwin+R\u8f93\u5165cmd\u6253\u5f00\u7ec8\u7aef\uff0c\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>nvidia-smi<\/code>\uff0c\u8fd9\u4e0a\u9762\u663e\u793a\u4e86\u6211\u80fd\u5b89\u88c5\u7684CUDA\u7248\u672c\u6700\u9ad8\u7684\u5c31\u662f12.7\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-84-1024x575.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-228\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-84-1024x575.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-84-300x168.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-84-768x431.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-84.png 1112w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u6211\u4eec\u6d4f\u89c8\u5668\u641c\u7d22<a href=\"https:\/\/pytorch.org\/\">PyTorch<\/a>\uff0c\u70b9\u51fbGet started\uff0c\u901a\u8fc7pytorch\u6765\u4e0b\u8f7dcudatoolkit\u548ccudnn\u5462\uff0c\u8fd9\u6837\u5c31\u4e0d\u9700\u8981\u53bb\u82f1\u4f1f\u8fbe\u7684\u5b98\u7f51\u53bb\u4e0b\u8f7d\uff0c\u7136\u540e\u518d\u914d\u7f6e\u73af\u5883\u4e86\uff0c\u8282\u7701\u4e86\u6b65\u9aa4\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-97-1024x532.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-242\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-97-1024x532.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-97-300x156.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-97-768x399.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-97-1536x798.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-97.png 1854w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u70b9\u51fbPrevious PyTorch Versions<a href=\"https:\/\/pytorch.org\/get-started\/previous-versions\/\">\u4e4b\u524d\u7684PyTorch\u7248\u672c<\/a>\uff0c\u8fd8\u662f\u4e0d\u8981\u4e0b\u8f7d\u6700\u65b0\u7684\u5462\uff0c\u4e0b\u8f7d\u4ee5\u524d\u7684\u7248\u672c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-98-1024x524.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-243\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-98-1024x524.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-98-300x154.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-98-768x393.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-98-1536x787.png 1536w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-98.png 1851w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u6211\u9009\u62e9\u7684\u662fpytorch2.5\u7684\u7248\u672c\uff0ccuda\u662f11.8\u7684\uff0c<code>conda install pytorch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 pytorch-cuda=11.8 -c pytorch -c nvidia<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-99-1024x612.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-244\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-99-1024x612.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-99-300x179.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-99-768x459.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-99.png 1158w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884canaconda prompt\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-100.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-246\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-100.png 717w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-100-300x285.png 300w\" sizes=\"(max-width: 717px) 100vw, 717px\" \/><\/figure>\n\n\n\n<p>\u8f93\u5165<code>conda create -n pytorch<\/code>\u6765\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u73af\u5883\uff0c<code>-n<\/code>\u540e\u9762\u662f\u4f60\u7684\u73af\u5883\u7684\u540d\u79f0\uff0c\u4f60\u53ef\u4ee5\u81ea\u5df1\u53d6\u7684\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-101-1024x452.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-247\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-101-1024x452.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-101-300x132.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-101-768x339.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-101.png 1068w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u8f93\u5165<code>conda env list<\/code>\u5c31\u53ef\u4ee5\u67e5\u770b\u6211\u4eec\u521a\u521a\u521b\u5efa\u7684\u73af\u5883\u4e86\uff0c\u518d\u8f93\u5165<code>conda activate pytorch<\/code>\u5c31\u53ef\u4ee5\u6fc0\u6d3b\u6211\u4eec\u7684\u73af\u5883\u4e86\uff0c<code>activate<\/code>\u540e\u9762\u5c31\u662f\u73af\u5883\u7684\u540d\u5b57\u3002\u8f93\u5165\u521a\u624d\u6211\u4eec\u518dpytorch\u5b98\u7f51\u627e\u5230\u7684\u4ee3\u7801\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u4e0b\u8f7d\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-102-1024x378.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-248\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-102-1024x378.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-102-300x111.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-102-768x284.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-102.png 1113w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u8f93\u5165<code>python<\/code>\u6765\u6253\u5f00python\u770b\u770b\u6211\u4eec\u6709\u6ca1\u6709\u5b89\u88c5\u6210\u529f\u5462\u3002\u4f9d\u6b21\u8f93\u5165\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u67e5\u770b<\/p>\n\n\n\n<p><code>import torch<br>print(\"torch:\", torch.<strong>version<\/strong>)<br>print(\"cuda available:\", torch.cuda.is_available())<br>print(\"cuda version:\", torch.version.cuda)<br>print(\"cudnn:\", torch.backends.cudnn.version())<br>print(\"gpu:\", torch.cuda.get_device_name(0))<\/code><\/p>\n\n\n\n<p>\u5982\u679c\u90fd\u6709\u8f93\u51fa\uff0c\u5e76\u4e14cuda availablel: True\u8bf4\u660e\u6211\u4eec\u5b89\u88c5\u6210\u529f\u4e86\u5462\ud83d\ude18\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-103-1024x576.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-249\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-103-1024x576.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-103-300x169.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-103-768x432.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-103.png 1113w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u6700\u540e\u8bf4\u4e00\u4e0b\u600e\u4e48\u5728Vscode\u91cc\u4f7f\u7528\u8fd9\u4e2a\u73af\u5883\u5462\uff0c\u70b9\u51fb\u754c\u9762\u7684\u53f3\u4e0b\u89d2\u7684\u7248\u672c\u53f7\uff0c\u5728\u4e0a\u9762\u5c31\u4f1a\u663e\u793a\u4f60\u6709\u7684\u6240\u4ee5\u7248\u672c\u4fe1\u606f\uff0c\u9009\u7528\u4f60\u7528conda\u521b\u5efa\u7684\u73af\u5883\u5c31\u884c\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-104-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-251\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-104-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-104-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-104-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-104.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4e0b\u9762\u5c31\u662f\u8fd0\u884c\u7ed3\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-105-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-252\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-105-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-105-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-105-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-105.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u8ffd\u52a0\u4e00\u4e0b<\/mark><\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u70b9\u51fb\u8fd0\u884c\u65f6\u4f1a\u5f39\u51fa\u547d\u4ee4\u884c\u7a97\u53e3\u95ea\u4e00\u4e0b\uff0c\u7136\u540e\u624d\u80fd\u8fd0\u884c\u7684\u60c5\u51b5\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-162-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-331\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-162-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-162-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-162-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-162.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u4e2a\u662f\u56e0\u4e3a\u6211\u4eec\u7ec8\u7aef\u9ed8\u8ba4\u662f\u7528\u4e86PowerShell\uff0c\u8fd9\u4e2a\u5728\u8fd0\u884c\u7684\u65f6\u5019\u4f1a\u8fdb\u884c\u4e00\u4e9bWindows\u7684\u914d\u7f6e\uff0c\u4e0d\u662f\u5f88\u65b9\u4fbf\uff0c\u6211\u4eec\u6362\u6210command prompt\u7684\u5c31\u597d\u591a\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-163-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-333\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-163-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-163-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-163-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-163.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u952e\u76d8\u8f93\u5165ctrl+shifl+P\uff0c\u7136\u540e\u8f93\u5165<code>teminal:select default profile<\/code>\u9009\u62e9\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-164-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-334\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-164-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-164-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-164-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-164.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u70b9\u51fbcommand prompt\uff0c\u8fd9\u6837\u5c31\u914d\u7f6e\u597d\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-165-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-335\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-165-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-165-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-165-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-165.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u5173\u95ed\u4e4b\u524d\u7684\u7ec8\u7aef\uff0c\u91cd\u65b0\u8fd0\u884c\u5c31\u4f1a\u53d1\u73b0\u6ca1\u6709\u547d\u4ee4\u884c\u7a97\u53e3\u5f39\u51fa\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\"  src=\"http:\/\/zgc.91svip.icu\/wp-content\/themes\/lolimeow-lolimeowV13.13\/assets\/images\/loading.gif\" data-src=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-166-1024x614.png\" class=\"lazy\" loading=\"lazy\" alt=\"\" class=\"wp-image-336\" srcset=\"https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-166-1024x614.png 1024w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-166-300x180.png 300w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-166-768x460.png 768w, https:\/\/zgc.91svip.icu\/wp-content\/uploads\/2025\/12\/image-166.png 1472w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u6700\u8fd1\u770b\u4e86\u5218\u4e8c\u5927\u4eba\u7684\u6df1\u5ea6\u5b66\u4e60\u8bfe\u7a0b\uff0c\u53c8\u71c3\u8d77\u5b66\u4e60\u7684\u5174\u8da3\uff0c\u6240\u4ee5\u6211\u5c31\u60f3\u7740\u91cd\u65b0\u4ece\u5934\u914d\u7f6e\u4e00\u4e0bpython\u7684\u73af\u5883\uff0c\u56e0\u4e3a\u4e4b\u524d\u5b66\u7684\u65f6\u5019\u5c31\u662f\u4e00\u77e5\u534a\u89e3\u7684\u3002\u987a\u4fbf\u628acuda\uff0ccudnn\u548canaconda\u4e5f\u7ed9\u5f04\u6e05\u695a\u3002\u53e6\u5916\u8bf4\u4e00\u4e0b\u5218\u4e8c\u5927\u4eba\u6df1\u5ea6\u5b66\u4e60\u8bfe\u7a0b\u8bb2\u7684\u662f\u771f\u7684\u597d\u5462\uff0c\u5927\u5bb6\u5982\u679c\u60f3\u5b66\u6df1\u5ea6\u5b66\u4e60\u7684\u53ef\u4ee5\u53bb\u770b\u770b\u3002 \u3010\u300aPyTorch\u6df1\u5ea6\u5b66\u4e60\u5b9e\u8df5\u300b\u5b8c\u7ed3\u5408\u96c6\u3011 https:\/\/www.bilibili.com\/video\/BV1Y7411d7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":254,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[28,30,29,31,27,32,25,26],"class_list":["post-186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-cuda","tag-cuda-toolkit","tag-cudnn","tag-geek","tag-gpu","tag-miniconda","tag-python","tag-pytorch"],"_links":{"self":[{"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":7,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":337,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/posts\/186\/revisions\/337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/media\/254"}],"wp:attachment":[{"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zgc.91svip.icu\/index.php\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}