{"id":89637,"date":"2026-08-03T11:41:04","date_gmt":"2026-08-03T03:41:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89637.html"},"modified":"2026-08-03T11:41:04","modified_gmt":"2026-08-03T03:41:04","slug":"%e3%80%90npu%e3%80%91ascend-device-plugin-%e7%b3%bb%e7%bb%9f%e7%ba%a7%e6%9e%b6%e6%9e%84%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89637.html","title":{"rendered":"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790"},"content":{"rendered":"<h2>Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790<\/h2>\n<p>\u6e90\u7801\u8def\u5f84: mind-cluster-v26.0.1\/component\/ascend-device-plugin \u5206\u6790\u65e5\u671f: 2026-07-31 \u6587\u4ef6\u7edf\u8ba1: 52\u4e2a\u975e\u6d4b\u8bd5Go\u6e90\u6587\u4ef6&#xff0c;\u7ea620,000\u884c\u4ee3\u7801 \u5236\u56fe\u5de5\u5177: fireworks-tech-graph (Style 1: Flat Icon)<\/p>\n<hr \/>\n<h3>\u76ee\u5f55<\/h3>\n<li>\u9879\u76ee\u6574\u4f53\u67b6\u6784\u4e0e\u8bbe\u8ba1\u601d\u8def<\/li>\n<li>\u6574\u4f53\u8fd0\u884c\u6d41\u7a0b<\/li>\n<li>\u5b50\u6a21\u5757\u5212\u5206\u603b\u89c8<\/li>\n<li>\u5165\u53e3\u5c42\u6a21\u5757 \u2014 main.go<\/li>\n<li>\u5de5\u5382\u5c42\u6a21\u5757 \u2014 DeviceFactory<\/li>\n<li>gRPC\u670d\u52a1\u5c42\u6a21\u5757 \u2014 Server<\/li>\n<li>\u8bbe\u5907\u7ba1\u7406\u5c42\u6a21\u5757 \u2014 Device<\/li>\n<li>\u516c\u5171\u57fa\u7840\u5c42\u6a21\u5757 \u2014 Common<\/li>\n<li>K8s\u5ba2\u6237\u7aef\u6a21\u5757 \u2014 KubeClient<\/li>\n<li>\u91cd\u590d\u8bbe\u5907\u68c0\u6d4b\u6a21\u5757 \u2014 DuplicateDetector<\/li>\n<li>\u62d3\u6251\u6a21\u5757 \u2014 Topology<\/li>\n<li>\u6a21\u5757\u95f4\u8c03\u7528\u5173\u7cfb\u4e0e\u6570\u636e\u6d41<\/li>\n<li>\u56fe\u8868\u7d22\u5f15<\/li>\n<hr \/>\n<h3>\u4e00\u3001\u9879\u76ee\u6574\u4f53\u67b6\u6784\u4e0e\u8bbe\u8ba1\u601d\u8def<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034055-6a700dc7b6f1b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>1.1 \u9879\u76ee\u5b9a\u4f4d<\/h4>\n<p>Ascend Device Plugin \u662f\u534e\u4e3a\u6607\u817eNPU\u7684 Kubernetes Device Plugin \u5b9e\u73b0&#xff0c;\u9075\u5faa Kubernetes Device Plugin \u534f\u8bae&#xff08;gRPC&#xff09;&#xff0c;\u8d1f\u8d23\u5c06\u7269\u7406NPU\u8bbe\u5907&#xff08;Ascend910\/310\/310P&#xff09;\u6ce8\u518c\u5230K8s\u96c6\u7fa4&#xff0c;\u7ba1\u7406\u8bbe\u5907\u7684\u53d1\u73b0\u3001\u5206\u914d\u3001\u5065\u5eb7\u76d1\u63a7\u548c\u6545\u969c\u5904\u7406\u3002<\/p>\n<h4>1.2 \u8bbe\u8ba1\u601d\u8def<\/h4>\n<p>\u91c7\u7528 \u5206\u5c42\u67b6\u6784 &#043; \u5de5\u5382\u6a21\u5f0f &#043; \u63a5\u53e3\u62bd\u8c61 &#043; CGO\u6865\u63a5 \u7684\u8bbe\u8ba1&#xff1a;<\/p>\n<table>\n<tr>\u8bbe\u8ba1\u539f\u5219\u5b9e\u73b0\u65b9\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>\u5206\u5c42\u67b6\u6784<\/td>\n<td>\u5165\u53e3\u5c42 \u2192 \u5de5\u5382\u5c42 \u2192 \u670d\u52a1\u5c42\/\u8bbe\u5907\u5c42 \u2192 \u57fa\u7840\u5c42&#xff0c;\u81ea\u4e0a\u800c\u4e0b\u5355\u5411\u4f9d\u8d56<\/td>\n<\/tr>\n<tr>\n<td>\u5de5\u5382\u6a21\u5f0f<\/td>\n<td>DeviceFactory \u6839\u636e\u8bbe\u5907\u7c7b\u578b\u521b\u5efa\u5bf9\u5e94\u7684 Manager \u5b9e\u4f8b<\/td>\n<\/tr>\n<tr>\n<td>\u63a5\u53e3\u62bd\u8c61<\/td>\n<td>DevManager \u63a5\u53e3\u7edf\u4e00\u4e0d\u540c\u578b\u53f7NPU\u7684\u64cd\u4f5c\u5951\u7ea6<\/td>\n<\/tr>\n<tr>\n<td>\u7ee7\u627f\u590d\u7528<\/td>\n<td>AscendTools \u57fa\u7c7b\u63d0\u4f9b\u901a\u7528\u80fd\u529b&#xff0c;910\/310\/310P \u5206\u522b\u7ee7\u627f\u6269\u5c55<\/td>\n<\/tr>\n<tr>\n<td>CGO\u6865\u63a5<\/td>\n<td>\u901a\u8fc7 CGO \u8c03\u7528\u5e95\u5c42 DCMI \u9a71\u52a8\u5e93&#xff08;libdcmi.so&#xff09;&#xff0c;\u5b9e\u73b0\u8bbe\u5907\u53d1\u73b0\/\u5065\u5eb7\/\u590d\u4f4d\u7b49\u786c\u4ef6\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>gRPC\u670d\u52a1<\/td>\n<td>\u5b9e\u73b0 K8s Device Plugin \u534f\u8bae\u7684 ListAndWatch\/Allocate \u63a5\u53e3<\/td>\n<\/tr>\n<tr>\n<td>\u4f18\u96c5\u5bb9\u9519<\/td>\n<td>\u6545\u969c\u5206\u7ea7\u5904\u7406&#xff08;L1\u8b66\u544a\u2192L2\u964d\u7ea7\u2192L3\u9694\u79bb\u2192L5\u91cd\u7f6e&#xff09;&#xff0c;\u652f\u6301\u70ed\u590d\u4f4d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1.3 \u67b6\u6784\u5206\u5c42<\/h4>\n<table>\n<tr>\u5c42\u6b21\u6a21\u5757\u6838\u5fc3\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>\u5165\u53e3\u5c42<\/td>\n<td>main.go<\/td>\n<td>\u547d\u4ee4\u884c\u89e3\u6790\u3001\u53c2\u6570\u6821\u9a8c(12\u9879)\u3001\u542f\u52a8\u521d\u59cb\u5316<\/td>\n<\/tr>\n<tr>\n<td>\u5de5\u5382\u5c42<\/td>\n<td>DeviceFactory<\/td>\n<td>\u8bbe\u5907\u9a71\u52a8\u521d\u59cb\u5316\u3001Manager\u521b\u5efa\u3001\u540d\u79f0\u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>gRPC\u670d\u52a1\u5c42<\/td>\n<td>Server<\/td>\n<td>gRPC\u670d\u52a1\u3001\u8bbe\u5907\u4e0a\u62a5(ListAndWatch)\u3001\u5206\u914d(Allocate)\u3001Pod\u8d44\u6e90\u67e5\u8be2<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u7ba1\u7406\u5c42<\/td>\n<td>Device<\/td>\n<td>NPU\u8bbe\u5907\u53d1\u73b0\u3001\u5065\u5eb7\u76d1\u63a7\u3001\u6545\u969c\u5904\u7406\u3001\u70ed\u590d\u4f4d\u3001\u865a\u62df\u8bbe\u5907(vNPU)<\/td>\n<\/tr>\n<tr>\n<td>\u516c\u5171\u57fa\u7840\u5c42<\/td>\n<td>Common<\/td>\n<td>\u5e38\u91cf\u3001\u5de5\u5177\u51fd\u6570\u3001\u6545\u969c\u7801\u3001\u534f\u8bae\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>K8s\u5ba2\u6237\u7aef\u5c42<\/td>\n<td>KubeClient<\/td>\n<td>K8s API\u4ea4\u4e92\u3001ConfigMap CRUD\u3001\u8282\u70b9Informer<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u590d\u68c0\u6d4b\u5c42<\/td>\n<td>DuplicateDetector<\/td>\n<td>\u5bb9\u5668\u8bbe\u5907\u6302\u8f7d\u91cd\u590d\u68c0\u6d4b&#xff08;Docker\/Containerd&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u62d3\u6251\u5c42<\/td>\n<td>Topology<\/td>\n<td>\u62d3\u6251\u6587\u4ef6\u8bfb\u5199\u3001Rack\u62d3\u6251\u91c7\u96c6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e8c\u3001\u6574\u4f53\u8fd0\u884c\u6d41\u7a0b<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034056-6a700dc8809a1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2.1 \u8fdb\u7a0b\u542f\u52a8\u6d41\u7a0b<\/h4>\n<p>1. main() \u5165\u53e3<br \/>\n   \u2193<br \/>\n2. initLogModule() \u2014 \u521d\u59cb\u5316\u65e5\u5fd7\u6a21\u5757<br \/>\n   \u2193<br \/>\n3. \u89e3\u6790\u547d\u4ee4\u884c Flag (&#8211;useV2 &#8211;dmVol &#8211;fdFlag &#8211;deviceType &#8230;)<br \/>\n   \u2193<br \/>\n4. checkParam() \u2014 \u53c2\u6570\u6821\u9a8c (12\u9879check\u51fd\u6570)<br \/>\n   \u251c\u2500\u2500 checkListWatchPeriod()           (ListAndWatch\u5468\u671f)<br \/>\n   \u251c\u2500\u2500 checkPresetAndVolcanoRelation()   (\u9884\u7f6e&#043;Volcano\u5173\u7cfb)<br \/>\n   \u251c\u2500\u2500 checkUse310PMixedInsertWithVolcano()<br \/>\n   \u251c\u2500\u2500 checkUse310PMixedInsertWithShareDevCount()<br \/>\n   \u251c\u2500\u2500 checkPresetWithShareDevCount()<br \/>\n   \u251c\u2500\u2500 checkSoftShareDevConfigDir()<br \/>\n   \u251c\u2500\u2500 checkHotResetMode()<br \/>\n   \u251c\u2500\u2500 checkBuildScene()<br \/>\n   \u251c\u2500\u2500 checkLinkdownTimeout()<br \/>\n   \u251c\u2500\u2500 checkThirdPartyScanDelay()<br \/>\n   \u251c\u2500\u2500 checkDeviceResetTimeout()<br \/>\n   \u2514\u2500\u2500 checkShareDevCount()<br \/>\n   \u2193<br \/>\n5. devicefactory.InitFunction()<br \/>\n   \u251c\u2500\u2500 initDevManager()<br \/>\n   \u2502   \u251c\u2500\u2500 AutoInit()          (DCMI\u9a71\u52a8\u521d\u59cb\u5316, CGO)<br \/>\n   \u2502   \u251c\u2500\u2500 NewHwAscend910Manager() \/ NewHwAscend310Manager() \/ NewHwAscend310PManager()<br \/>\n   \u2502   \u2514\u2500\u2500 InitSwitchDev()     (\u4ea4\u6362\u8bbe\u5907\u521d\u59cb\u5316)<br \/>\n   \u2193<br \/>\n6. NewHwDevManager() \u521b\u5efa\u8bbe\u5907\u7ba1\u7406\u5668<br \/>\n   \u251c\u2500\u2500 setAscendManager()  (\u6309\u8bbe\u5907\u7c7b\u578b\u8bbe\u7f6eManager)<br \/>\n   \u251c\u2500\u2500 setAllDeviceAndType()<br \/>\n   \u251c\u2500\u2500 initPluginServer()<br \/>\n   \u2193<br \/>\n7. ListenDevice() \u2014 \u542f\u52a8\u4e3b\u5faa\u73af<br \/>\n   \u251c\u2500\u2500 Serve()         (gRPC\u670d\u52a1\u534f\u7a0b)<br \/>\n   \u251c\u2500\u2500 subscribeNpuFaultEvent() (\u6545\u969c\u8ba2\u9605\u534f\u7a0b)<br \/>\n   \u251c\u2500\u2500 pollFaultCodeCM()  (\u6545\u969c\u7801\u8f6e\u8be2\u534f\u7a0b)<br \/>\n   \u2514\u2500\u2500 ticker \u5b9a\u65f6\u4efb\u52a1   (\u8bbe\u5907\u4fe1\u606f\u66f4\u65b0)<br \/>\n   \u2193<br \/>\n8. \u963b\u585e\u7b49\u5f85\u4fe1\u53f7 (SIGTERM\/SIGINT)<\/p>\n<h4>2.2 \u8fd0\u884c\u65f6\u6838\u5fc3\u534f\u7a0b<\/h4>\n<p>\u8fdb\u7a0b\u542f\u52a8\u540e\u8fdb\u5165 ListenDevice() \u4e3b\u5faa\u73af&#xff0c;\u540c\u65f6\u8fd0\u884c\u591a\u4e2a\u534f\u7a0b&#xff1a;<\/p>\n<table>\n<tr>\u534f\u7a0b\u529f\u80fd\u89e6\u53d1\u65b9\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>Serve<\/td>\n<td>gRPC\u670d\u52a1&#xff0c;\u54cd\u5e94kubelet\u7684ListAndWatch\/Allocate\u8bf7\u6c42<\/td>\n<td>\u6301\u7eed\u76d1\u542c<\/td>\n<\/tr>\n<tr>\n<td>subscribeNpuFaultEvent<\/td>\n<td>\u8ba2\u9605NPU\u786c\u4ef6\u6545\u969c\u4e8b\u4ef6&#xff08;DCMI\u56de\u8c03&#xff09;<\/td>\n<td>\u4e8b\u4ef6\u9a71\u52a8<\/td>\n<\/tr>\n<tr>\n<td>pollFaultCodeCM<\/td>\n<td>\u8f6e\u8be2ConfigMap\u4e2d\u7684\u6545\u969c\u7801<\/td>\n<td>\u5b9a\u65f6\u8f6e\u8be2<\/td>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>\u5468\u671f\u66f4\u65b0\u8bbe\u5907\u4fe1\u606f\u5230K8s ConfigMap<\/td>\n<td>30s\u5b9a\u65f6\u5668<\/td>\n<\/tr>\n<tr>\n<td>triggerTicker<\/td>\n<td>\u89e6\u53d1\u5f0f\u8bbe\u5907\u4fe1\u606f\u66f4\u65b0<\/td>\n<td>\u4e8b\u4ef6\u89e6\u53d1<\/td>\n<\/tr>\n<tr>\n<td>ListenDpu<\/td>\n<td>DPU\u5065\u5eb7\u72b6\u6001\u76d1\u63a7<\/td>\n<td>\u6301\u7eed\u76d1\u542c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e09\u3001\u5b50\u6a21\u5757\u5212\u5206\u603b\u89c8<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034057-6a700dc94a1e4.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>3.1 \u6a21\u5757\u603b\u89c8<\/h4>\n<table>\n<tr>\u6a21\u5757\u76ee\u5f55\u6587\u4ef6\u6570\u6838\u5fc3\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>\u5165\u53e3\u5c42<\/td>\n<td>main.go<\/td>\n<td>1<\/td>\n<td>\u8fdb\u7a0b\u5165\u53e3\u3001\u53c2\u6570\u89e3\u6790\u300112\u9879\u6821\u9a8c\u3001\u542f\u52a8\u521d\u59cb\u5316<\/td>\n<\/tr>\n<tr>\n<td>\u5de5\u5382\u5c42<\/td>\n<td>pkg\/next\/devicefactory\/<\/td>\n<td>3<\/td>\n<td>\u9a71\u52a8\u521d\u59cb\u5316\u3001Manager\u521b\u5efa\u3001\u540d\u79f0\u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>\u62d3\u6251\u5c42<\/td>\n<td>pkg\/topology\/<\/td>\n<td>2<\/td>\n<td>\u62d3\u6251\u6587\u4ef6\u8bfb\u5199\u3001Rack\u62d3\u6251\u91c7\u96c6\u3001\u6587\u4ef6\u54c8\u5e0c\u6821\u9a8c<\/td>\n<\/tr>\n<tr>\n<td>gRPC\u670d\u52a1\u5c42<\/td>\n<td>pkg\/server\/<\/td>\n<td>10<\/td>\n<td>gRPC\u670d\u52a1\u3001\u8bbe\u5907\u4e0a\u62a5\/\u5206\u914d\u3001DPU\u76d1\u63a7\u3001A5\u6269\u5c55<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u7ba1\u7406\u5c42<\/td>\n<td>pkg\/device\/<\/td>\n<td>7<\/td>\n<td>NPU\u8bbe\u5907\u53d1\u73b0\/\u5065\u5eb7\/\u6545\u969c\/\u590d\u4f4d\u3001vNPU\u7ba1\u7406<\/td>\n<\/tr>\n<tr>\n<td>\u4ea4\u6362\u8bbe\u5907<\/td>\n<td>pkg\/device\/deviceswitch\/<\/td>\n<td>1<\/td>\n<td>\u4ea4\u6362\u82af\u7247\u6545\u969c\u76d1\u63a7&#xff08;CGO&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>DPU\u63a7\u5236<\/td>\n<td>pkg\/device\/dpucontrol\/<\/td>\n<td>2<\/td>\n<td>DPU\u53d1\u73b0\u4e0e\u914d\u7f6e&#xff08;UB\/PCIe\u4e24\u79cd\u6a21\u5f0f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u516c\u5171\u57fa\u7840\u5c42<\/td>\n<td>pkg\/common\/<\/td>\n<td>13<\/td>\n<td>\u5e38\u91cf\u3001\u5de5\u5177\u3001\u6545\u969c\u7801\u3001\u534f\u8bae\u3001\u6587\u4ef6\u7ba1\u7406<\/td>\n<\/tr>\n<tr>\n<td>K8s\u5ba2\u6237\u7aef<\/td>\n<td>pkg\/kubeclient\/<\/td>\n<td>7<\/td>\n<td>K8s API\u4ea4\u4e92\u3001Informer\u3001\u7f13\u5b58\u3001CRUD<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u590d\u68c0\u6d4b<\/td>\n<td>pkg\/duplicatedetector\/<\/td>\n<td>6<\/td>\n<td>\u5bb9\u5668\u8bbe\u5907\u6302\u8f7d\u91cd\u590d\u68c0\u6d4b&#xff08;Docker\/Containerd&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u56db\u3001\u5165\u53e3\u5c42\u6a21\u5757 \u2014 main.go<\/h3>\n<h4>4.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u8fdb\u7a0b\u5165\u53e3\u70b9&#xff0c;\u8d1f\u8d23\u547d\u4ee4\u884c\u53c2\u6570\u89e3\u6790\u3001\u53c2\u6570\u6821\u9a8c\u548c\u521d\u59cb\u5316\u8c03\u5ea6\u3002\u4e0d\u5305\u542b\u4e1a\u52a1\u903b\u8f91&#xff0c;\u53ea\u505a \u7f16\u6392\u8c03\u5ea6\u3002<\/p>\n<h4>4.2 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u884c\u53f7\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>main()<\/td>\n<td>269<\/td>\n<td>\u5165\u53e3\u51fd\u6570&#xff1a;\u89e3\u6790Flag \u2192 checkParam() \u2192 InitFunction() \u2192 ListenDevice()<\/td>\n<\/tr>\n<tr>\n<td>initLogModule()<\/td>\n<td>111<\/td>\n<td>\u521d\u59cb\u5316\u65e5\u5fd7\u6a21\u5757&#xff08;\u4e0a\u4e0b\u6587&#043;\u65e5\u5fd7\u7ea7\u522b&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>checkParam()<\/td>\n<td>134<\/td>\n<td>\u8c03\u752812\u9879check\u51fd\u6570&#xff0c;\u4efb\u4e00\u5931\u8d25\u5219\u7ec8\u6b62\u542f\u52a8<\/td>\n<\/tr>\n<tr>\n<td>setParameters()<\/td>\n<td>303<\/td>\n<td>\u8bbe\u7f6e\u5168\u5c40\u53c2\u6570&#xff08;\u8bbe\u5907\u7c7b\u578b\u3001\u5377\u8def\u5f84\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>setUseAscendDocker()<\/td>\n<td>326<\/td>\n<td>\u8bbe\u7f6e\u662f\u5426\u4f7f\u7528Ascend Docker\u8fd0\u884c\u65f6<\/td>\n<\/tr>\n<tr>\n<td>checkListWatchPeriod()<\/td>\n<td>157<\/td>\n<td>\u6821\u9a8cListAndWatch\u5468\u671f\u5408\u6cd5\u6027<\/td>\n<\/tr>\n<tr>\n<td>checkHotResetMode()<\/td>\n<td>218<\/td>\n<td>\u6821\u9a8c\u70ed\u590d\u4f4d\u6a21\u5f0f\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>checkBuildScene()<\/td>\n<td>228<\/td>\n<td>\u6821\u9a8c\u6784\u5efa\u573a\u666f&#xff08;\u8bad\u7ec3\/\u63a8\u7406&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>checkShareDevCount()<\/td>\n<td>261<\/td>\n<td>\u6821\u9a8c\u5171\u4eab\u8bbe\u5907\u6570\u91cf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4.3 \u5173\u952eFlag<\/h4>\n<table>\n<tr>Flag\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>&#8211;useV2<\/td>\n<td>\u4f7f\u7528V2\u63a5\u53e3&#xff08;A5\u67b6\u6784&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>&#8211;dmVol<\/td>\n<td>\u8bbe\u5907\u7ba1\u7406\u5377\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td>&#8211;fdFlag<\/td>\n<td>\u6587\u4ef6\u63cf\u8ff0\u7b26\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>&#8211;deviceType<\/td>\n<td>\u8bbe\u5907\u7c7b\u578b&#xff08;Ascend910\/310\/310P&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>&#8211;listWatchPeriod<\/td>\n<td>ListAndWatch\u4e0a\u62a5\u5468\u671f<\/td>\n<\/tr>\n<tr>\n<td>&#8211;hotResetMode<\/td>\n<td>\u70ed\u590d\u4f4d\u6a21\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>&#8211;presetEnable<\/td>\n<td>\u9884\u7f6e\u529f\u80fd\u5f00\u5173<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e94\u3001\u5de5\u5382\u5c42\u6a21\u5757 \u2014 DeviceFactory<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034058-6a700dca0b149.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>5.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u8bbe\u5907\u5de5\u5382\u5c42&#xff0c;\u8d1f\u8d23\u6839\u636e\u8bbe\u5907\u7c7b\u578b\u521b\u5efa\u5bf9\u5e94\u7684 Manager \u5b9e\u4f8b&#xff0c;\u521d\u59cb\u5316\u786c\u4ef6\u9a71\u52a8&#xff0c;\u5efa\u7acb\u8bbe\u5907\u540d\u79f0\u6620\u5c04\u3002<\/p>\n<h4>5.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>entry.go<\/td>\n<td>\u5de5\u5382\u5165\u53e3&#xff0c;InitFunction() \u8c03\u7528\u94fe<\/td>\n<\/tr>\n<tr>\n<td>driver_init.go<\/td>\n<td>\u9a71\u52a8\u521d\u59cb\u5316&#xff0c;initDevManager() \u521b\u5efaManager<\/td>\n<\/tr>\n<tr>\n<td>customname\/public_name_config.go<\/td>\n<td>\u8bbe\u5907\u540d\u79f0\u6620\u5c04&#xff08;ResourceType\u2192PublicName&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5.3 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u6587\u4ef6\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>InitFunction()<\/td>\n<td>entry.go<\/td>\n<td>\u5de5\u5382\u5165\u53e3&#xff0c;\u8c03\u7528initDevManager\u521b\u5efaManager\u548cSwitchDevManager<\/td>\n<\/tr>\n<tr>\n<td>initDevManager()<\/td>\n<td>driver_init.go<\/td>\n<td>DCMI AutoInit \u2192 \u6309\u8bbe\u5907\u7c7b\u578b\u521b\u5efaManager \u2192 InitSwitchDev<\/td>\n<\/tr>\n<tr>\n<td>InitPublicNameConfig()<\/td>\n<td>public_name_config.go<\/td>\n<td>\u52a0\u8f7d\u540d\u79f0\u6620\u5c04\u914d\u7f6e\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>ReplaceDevicePublicName()<\/td>\n<td>public_name_config.go<\/td>\n<td>\u8bbe\u5907\u540d\u79f0\u66ff\u6362&#xff08;\u539f\u59cb\u2192\u516c\u5171\u540d\u79f0&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ReplaceDeviceInfoPublicName()<\/td>\n<td>public_name_config.go<\/td>\n<td>\u6279\u91cf\u8bbe\u5907\u4fe1\u606f\u540d\u79f0\u66ff\u6362<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5.4 \u540d\u79f0\u6620\u5c04\u673a\u5236<\/h4>\n<p>ResourceType (\u539f\u59cb: Ascend910)<br \/>\n    \u2193 InitPublicNameConfig()<br \/>\nOldPublicType (\u65e7\u516c\u5171: Ascend910A)<br \/>\n    \u2193 ReplaceDevicePublicName()<br \/>\nDevicePublicType (\u65b0\u516c\u5171: HuaweiNPU-910A)<\/p>\n<p>\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u8986\u76d6\u9ed8\u8ba4\u6620\u5c04&#xff0c;\u7528\u4e8eK8s\u8d44\u6e90\u6ce8\u518c\u540d\u548cPod\u6ce8\u89e3\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001gRPC\u670d\u52a1\u5c42\u6a21\u5757 \u2014 Server<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034058-6a700dcabf7e8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>6.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u5b9e\u73b0 Kubernetes Device Plugin gRPC \u534f\u8bae&#xff0c;\u5411 kubelet \u4e0a\u62a5\u8bbe\u5907\u5217\u8868\u548c\u5065\u5eb7\u72b6\u6001&#xff0c;\u5904\u7406\u8bbe\u5907\u5206\u914d\u8bf7\u6c42&#xff0c;\u67e5\u8be2Pod\u8bbe\u5907\u8d44\u6e90&#xff0c;\u76d1\u63a7DPU\u5065\u5eb7\u72b6\u6001\u3002<\/p>\n<h4>6.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>manager.go<\/td>\n<td>HwDevManager \u2014 \u8bbe\u5907\u7ba1\u7406\u4e2d\u67a2&#xff0c;10\u6b65\u521d\u59cb\u5316<\/td>\n<\/tr>\n<tr>\n<td>plugin.go<\/td>\n<td>PluginServer \u2014 gRPC\u63a5\u53e3\u5b9e\u73b0 (ListAndWatch\/Allocate)<\/td>\n<\/tr>\n<tr>\n<td>server.go<\/td>\n<td>Server \u2014 gRPC\u670d\u52a1\u5668\u542f\u52a8\/\u6ce8\u518c\/\u91cd\u542f<\/td>\n<\/tr>\n<tr>\n<td>pod_resource.go<\/td>\n<td>PodResource \u2014 Pod\u8bbe\u5907\u8d44\u6e90\u67e5\u8be2<\/td>\n<\/tr>\n<tr>\n<td>dpu.go<\/td>\n<td>DPU\u5065\u5eb7\u72b6\u6001\u76d1\u63a7<\/td>\n<\/tr>\n<tr>\n<td>types.go<\/td>\n<td>PluginServer\u7ed3\u6784\u4f53\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>manager_v2.go<\/td>\n<td>A5\u67b6\u6784\u6269\u5c55&#xff08;RankTable\/LevelList&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>plugin_v2.go<\/td>\n<td>V2 gRPC\u63a5\u53e3&#xff08;HCCL\u62d3\u6251&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>npu_base_v2.go<\/td>\n<td>A5 NPU\u57fa\u7c7b<\/td>\n<\/tr>\n<tr>\n<td>types_v2.go<\/td>\n<td>V2\u7c7b\u578b\u5b9a\u4e49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.3 \u5173\u952e\u7ed3\u6784\u4f53<\/h4>\n<table>\n<tr>\u7ed3\u6784\u4f53\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>HwDevManager<\/td>\n<td>\u8bbe\u5907\u7ba1\u7406\u4e2d\u67a2&#xff0c;\u534f\u8c03Device\/KubeClient\/PluginServer\u7b49\u6240\u6709\u5b50\u6a21\u5757<\/td>\n<\/tr>\n<tr>\n<td>PluginServer<\/td>\n<td>gRPC\u670d\u52a1\u5b9e\u73b0&#xff0c;\u5b9e\u73b0InterfaceServer\u63a5\u53e3&#xff08;ListAndWatch\/Allocate&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>PodResource<\/td>\n<td>Pod\u8bbe\u5907\u8d44\u6e90\u67e5\u8be2&#xff0c;\u5bf9\u63a5kubelet Pod Resources API<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.4 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u6587\u4ef6\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>NewHwDevManager()<\/td>\n<td>manager.go<\/td>\n<td>\u521b\u5efaManager\u5b9e\u4f8b&#xff0c;10\u6b65\u521d\u59cb\u5316\u6d41\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>setAscendManager()<\/td>\n<td>manager.go<\/td>\n<td>\u6309\u8bbe\u5907\u7c7b\u578b\u8bbe\u7f6e\u5bf9\u5e94\u7684Manager<\/td>\n<\/tr>\n<tr>\n<td>ListenDevice()<\/td>\n<td>manager.go<\/td>\n<td>\u4e3b\u5faa\u73af&#xff0c;\u542f\u52a8\u6240\u6709\u534f\u7a0b&#xff08;Serve\/\u6545\u969c\u8ba2\u9605\/ticker&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ListAndWatch()<\/td>\n<td>plugin.go:321<\/td>\n<td>gRPC&#xff1a;\u5468\u671f\u4e0a\u62a5\u8bbe\u5907\u5217\u8868\u548c\u5065\u5eb7\u72b6\u6001\u5230kubelet<\/td>\n<\/tr>\n<tr>\n<td>Allocate()<\/td>\n<td>plugin.go<\/td>\n<td>gRPC&#xff1a;\u5904\u7406\u8bbe\u5907\u5206\u914d\u8bf7\u6c42&#xff0c;\u6302\u8f7d\u8bbe\u5907\u5230\u5bb9\u5668<\/td>\n<\/tr>\n<tr>\n<td>responseToKubelet()<\/td>\n<td>plugin.go:201<\/td>\n<td>\u6784\u9020ListAndWatch\u54cd\u5e94&#xff08;\u8bbe\u5907\u5217\u8868&#043;\u5065\u5eb7\u72b6\u6001&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>reportDeviceInfo()<\/td>\n<td>plugin.go:286<\/td>\n<td>\u4e0a\u62a5\u8bbe\u5907\u4fe1\u606f&#xff08;\u6df1\u62f7\u8d1d\u2192\u6bd4\u5bf9\u2192\u66f4\u65b0&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>handleConsecutiveErrorStrategy()<\/td>\n<td>plugin.go:300<\/td>\n<td>\u8fde\u7eed\u9519\u8bef\u5904\u7406\u7b56\u7565&#xff08;\u91cd\u542f\/\u9000\u51fa&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Notify()<\/td>\n<td>plugin.go:61<\/td>\n<td>\u8bbe\u5907\u72b6\u6001\u53d8\u66f4\u901a\u77e5&#xff08;\u6545\u969c\u2192\u4e0d\u5065\u5eb7&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>getNewNodeAnnotation()<\/td>\n<td>manager.go:239<\/td>\n<td>\u83b7\u53d6\u8282\u70b9\u6ce8\u89e3&#xff08;\u8bbe\u5907\u4fe1\u606f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>getNewNodeLabel()<\/td>\n<td>manager.go:264<\/td>\n<td>\u83b7\u53d6\u8282\u70b9\u6807\u7b7e&#xff08;\u8bbe\u5907\u7c7b\u578b\/\u6570\u91cf&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>addTopologyLabel()<\/td>\n<td>manager.go:311<\/td>\n<td>\u6dfb\u52a0\u62d3\u6251\u6807\u7b7e<\/td>\n<\/tr>\n<tr>\n<td>updateChipNameToNode()<\/td>\n<td>manager.go:363<\/td>\n<td>\u66f4\u65b0\u82af\u7247\u540d\u79f0\u5230\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>initPluginServer()<\/td>\n<td>manager.go:457<\/td>\n<td>\u521d\u59cb\u5316PluginServer<\/td>\n<\/tr>\n<tr>\n<td>Serve()<\/td>\n<td>server.go<\/td>\n<td>gRPC\u670d\u52a1\u5668\u542f\u52a8\/\u6ce8\u518c\/\u91cd\u542f\/\u505c\u6b62<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.5 gRPC\u63a5\u53e3<\/h4>\n<table>\n<tr>\u63a5\u53e3\u65b9\u5411\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>ListAndWatch<\/td>\n<td>Plugin \u2192 kubelet<\/td>\n<td>\u6301\u7eed\u63a8\u9001\u8bbe\u5907\u5217\u8868&#xff08;Device\u6570\u7ec4&#043;\u5065\u5eb7\u72b6\u6001&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Allocate<\/td>\n<td>kubelet \u2192 Plugin<\/td>\n<td>\u8bf7\u6c42\u5206\u914d\u8bbe\u5907&#xff0c;\u8fd4\u56de\u8bbe\u5907\u6302\u8f7d\u4fe1\u606f(Mount)<\/td>\n<\/tr>\n<tr>\n<td>GetDevicePluginOptions<\/td>\n<td>kubelet \u2192 Plugin<\/td>\n<td>\u8fd4\u56de\u63d2\u4ef6\u9009\u9879<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e03\u3001\u8bbe\u5907\u7ba1\u7406\u5c42\u6a21\u5757 \u2014 Device<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034059-6a700dcb8547e.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>7.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>NPU\u8bbe\u5907\u7684\u5e95\u5c42\u7ba1\u7406\u2014\u2014\u8bbe\u5907\u53d1\u73b0\u3001\u5065\u5eb7\u72b6\u6001\u3001\u6545\u969c\u5904\u7406\u3001\u70ed\u590d\u4f4d\u3001\u865a\u62df\u8bbe\u5907&#xff08;vNPU&#xff09;\u7ba1\u7406\u3002\u901a\u8fc7CGO\u8c03\u7528DCMI\u9a71\u52a8\u5e93\u64cd\u4f5c\u786c\u4ef6\u3002<\/p>\n<h4>7.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>ascendcommon.go<\/td>\n<td>AscendTools\u57fa\u7c7b &#043; DevManager\u63a5\u53e3<\/td>\n<\/tr>\n<tr>\n<td>ascend910.go<\/td>\n<td>Ascend910 Manager&#xff08;\u8bad\u7ec3NPU&#xff0c;\u529f\u80fd\u6700\u5b8c\u6574&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ascend310.go<\/td>\n<td>Ascend310 Manager&#xff08;\u63a8\u7406NPU&#xff0c;\u7b80\u5316\u7248&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ascend310p.go<\/td>\n<td>Ascend310P Manager&#xff08;\u63a8\u7406NPU&#xff0c;4\u79cd\u6a21\u5f0f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ascendtolerance.go<\/td>\n<td>\u4f18\u96c5\u5bb9\u9519\u7ba1\u7406&#xff08;\u6545\u969c\u5206\u7ea7\u5904\u7406&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>reset_info_mgr.go<\/td>\n<td>\u91cd\u7f6e\u4fe1\u606f\u7ba1\u7406\u5668&#xff08;\u5355\u4f8b\u6a21\u5f0f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ascendcommon_v2.go<\/td>\n<td>A5\u67b6\u6784\u6269\u5c55\u5c5e\u6027<\/td>\n<\/tr>\n<tr>\n<td>deviceswitch\/ascend_switch.go<\/td>\n<td>\u4ea4\u6362\u8bbe\u5907\u6545\u969c\u76d1\u63a7&#xff08;CGO&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>dpucontrol\/dpu_device_find.go<\/td>\n<td>DPU\u53d1\u73b0\u4e0e\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>dpucontrol\/types.go<\/td>\n<td>DPU\u7c7b\u578b\u5b9a\u4e49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7.3 \u7ee7\u627f\u4f53\u7cfb<\/h4>\n<p>DevManager (\u63a5\u53e3)<br \/>\n    \u2191 \u5b9e\u73b0<br \/>\nAscendTools (\u57fa\u7c7b) \u2014 \u63d0\u4f9bGetNPUs\/UpdateNodeDeviceInfo\u7b49\u901a\u7528\u65b9\u6cd5<br \/>\n    \u2191 \u7ee7\u627f<br \/>\n    \u251c\u2500\u2500 HwAscend910Manager   (\u8bad\u7ec3\u5361: \u6545\u969c\u8ba2\u9605\/\u70ed\u590d\u4f4d\/Ring\u91cd\u7f6e\/\u4f18\u96c5\u5bb9\u9519)<br \/>\n    \u251c\u2500\u2500 HwAscend310Manager   (\u63a8\u7406\u5361: \u7b80\u5316\u7248\u8bbe\u5907\u53d1\u73b0)<br \/>\n    \u2514\u2500\u2500 HwAscend310PManager  (\u63a8\u7406\u5361: \u6df7\u63d2\/\u865a\u62df\/\u5171\u4eab\/\u7269\u74064\u79cd\u6a21\u5f0f)<\/p>\n<h4>7.4 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u6240\u5c5e\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>GetNPUs()<\/td>\n<td>Ascend910<\/td>\n<td>\u8bbe\u5907\u53d1\u73b0&#xff1a;\u626b\u63cf\/dev\/davinci*\u8bbe\u5907&#xff0c;\u8fd4\u56deNpuAllInfo<\/td>\n<\/tr>\n<tr>\n<td>GraceTolerance()<\/td>\n<td>Ascend910<\/td>\n<td>\u4f18\u96c5\u5bb9\u95196\u6b65\u6d41\u7a0b&#xff1a;\u5206\u7c7b\u8bbe\u5907\u2192\u6545\u969c\u5206\u7ea7\u2192\u70ed\u590d\u4f4d<\/td>\n<\/tr>\n<tr>\n<td>hotResetHandler()<\/td>\n<td>Ascend910<\/td>\n<td>\u70ed\u590d\u4f4d\u5904\u7406&#xff08;\u5e26\u5185\/\u5e26\u5916\u4e24\u79cd\u6a21\u5f0f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>hotResetTryOutBand()<\/td>\n<td>Ascend910<\/td>\n<td>\u5e26\u5916\u70ed\u590d\u4f4d\u6267\u884c<\/td>\n<\/tr>\n<tr>\n<td>startUpHotReset()<\/td>\n<td>Ascend910<\/td>\n<td>\u542f\u52a8\u70ed\u590d\u4f4d\u6d41\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>setAllDevUnhealthyOnRing()<\/td>\n<td>Ascend910<\/td>\n<td>Ring\u4e0a\u6240\u6709\u8bbe\u5907\u8bbe\u4e3a\u4e0d\u5065\u5eb7<\/td>\n<\/tr>\n<tr>\n<td>getDevFaultInfo()<\/td>\n<td>Ascend910<\/td>\n<td>\u83b7\u53d6\u8bbe\u5907\u6545\u969c\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>isFaultNeedRestart()<\/td>\n<td>Ascend910<\/td>\n<td>\u5224\u65ad\u6545\u969c\u662f\u5426\u9700\u8981\u91cd\u542f<\/td>\n<\/tr>\n<tr>\n<td>GetAssociatedLogicIDs()<\/td>\n<td>Ascend910<\/td>\n<td>\u83b7\u53d6\u5173\u8054\u8bbe\u5907\u903b\u8f91ID&#xff08;Ring\u62d3\u6251&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>SetDmgr()<\/td>\n<td>AscendTools<\/td>\n<td>\u8bbe\u7f6e\u8bbe\u5907\u7ba1\u7406\u5668<\/td>\n<\/tr>\n<tr>\n<td>GetChipAICore()<\/td>\n<td>AscendTools<\/td>\n<td>\u83b7\u53d6\u82af\u7247AI Core\u6570\u91cf<\/td>\n<\/tr>\n<tr>\n<td>convertLogicIDsToDeviceNames()<\/td>\n<td>AscendTools<\/td>\n<td>\u903b\u8f91ID\u8f6c\u8bbe\u5907\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td>UpdateNodeDeviceInfo()<\/td>\n<td>AscendTools<\/td>\n<td>\u66f4\u65b0\u8bbe\u5907\u4fe1\u606f\u5230ConfigMap<\/td>\n<\/tr>\n<tr>\n<td>LoadDeviceInfoCm()<\/td>\n<td>AscendTools<\/td>\n<td>\u52a0\u8f7d\u8bbe\u5907\u4fe1\u606fConfigMap<\/td>\n<\/tr>\n<tr>\n<td>handleManuallySeparateNPUFaultInfo()<\/td>\n<td>AscendTools<\/td>\n<td>\u5904\u7406\u624b\u52a8\u5206\u79bbNPU\u6545\u969c\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>asyncReleaseAutoFill()<\/td>\n<td>AscendTools<\/td>\n<td>\u5f02\u6b65\u91ca\u653e\u81ea\u52a8\u586b\u5145<\/td>\n<\/tr>\n<tr>\n<td>checkAndInitNodeDeviceInfo()<\/td>\n<td>AscendTools<\/td>\n<td>\u68c0\u67e5\u5e76\u521d\u59cb\u5316\u8282\u70b9\u8bbe\u5907\u4fe1\u606f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7.5 \u6545\u969c\u5904\u7406\u6d41\u7a0b<\/h4>\n<p>DCMI\u9a71\u52a8 \u2192 goFaultEventHandler (CGO\u56de\u8c03)<br \/>\n    \u2193<br \/>\n\u6545\u969c\u4e8b\u4ef6 \u2192 allFaultInfo channel<br \/>\n    \u2193<br \/>\n\u9650\u6d41\u5668 (rate limiter)<br \/>\n    \u2193<br \/>\n\u6545\u969c\u5206\u7ea7:<br \/>\n  L1 (\u8b66\u544a)   \u2192 \u8bb0\u5f55\u65e5\u5fd7&#xff0c;\u8bbe\u5907\u4fdd\u6301\u5065\u5eb7<br \/>\n  L2 (\u964d\u7ea7)   \u2192 \u8bbe\u5907\u6807\u8bb0\u4e3a\u4e0d\u5065\u5eb7<br \/>\n  L3 (\u9694\u79bb)   \u2192 \u8bbe\u5907\u9694\u79bb &#043; K8s Event\u901a\u77e5<br \/>\n  L5 (\u91cd\u7f6e)   \u2192 \u89e6\u53d1\u70ed\u590d\u4f4d (\u5e26\u5185\/\u5e26\u5916)<br \/>\n    \u2193<br \/>\nK8s Event \u901a\u77e5 &#043; ConfigMap \u66f4\u65b0 &#043; ListAndWatch\u72b6\u6001\u66f4\u65b0<\/p>\n<hr \/>\n<h3>\u516b\u3001\u516c\u5171\u57fa\u7840\u5c42\u6a21\u5757 \u2014 Common<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034100-6a700dcc6f3ae.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>8.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u5168\u5c40\u5e38\u91cf\u3001\u5de5\u5177\u51fd\u6570\u3001\u6545\u969c\u7801\u5b9a\u4e49\u3001\u534f\u8bae\u5b9a\u4e49\u2014\u2014\u88ab\u51e0\u4e4e\u6240\u6709\u5176\u4ed6\u6a21\u5757\u5f15\u7528\u7684&#034;\u5355\u4e00\u771f\u76f8\u6e90&#034;\u3002<\/p>\n<h4>8.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>constants.go<\/td>\n<td>\u5168\u5c40\u5e38\u91cf&#xff08;\u8bbe\u5907\u7c7b\u578b\/\u8def\u5f84\/\u7aef\u53e3\/\u9650\u5236\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>constants_v2.go<\/td>\n<td>A5\u67b6\u6784\u5e38\u91cf<\/td>\n<\/tr>\n<tr>\n<td>common.go<\/td>\n<td>\u516c\u5171\u5de5\u5177\u51fd\u6570&#xff08;\u5e8f\u5217\u5316\/\u9501\/\u54c8\u5e0c\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>device.go<\/td>\n<td>\u8bbe\u5907\u5de5\u5177\u51fd\u6570&#xff08;\u8bbe\u5907ID\u89e3\u6790\/\u4ea4\u6362\u6545\u969c\/\u9ed8\u8ba4\u8bbe\u5907\u8def\u5f84&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>fault_code.go<\/td>\n<td>\u6545\u969c\u7801\u5b9a\u4e49\u4e0e\u7ea7\u522b\u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>proto.go<\/td>\n<td>\u534f\u8bae\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>proto_v2.go<\/td>\n<td>A5\u534f\u8bae\u5b9a\u4e49<\/td>\n<\/tr>\n<tr>\n<td>send_stat.go<\/td>\n<td>\u72b6\u6001\u4e0a\u62a5<\/td>\n<\/tr>\n<tr>\n<td>file_manager.go<\/td>\n<td>\u6587\u4ef6\u7ba1\u7406<\/td>\n<\/tr>\n<tr>\n<td>atomic_bool.go<\/td>\n<td>\u539f\u5b50\u5e03\u5c14\u503c<\/td>\n<\/tr>\n<tr>\n<td>slice_common.go<\/td>\n<td>\u5207\u7247\u5de5\u5177<\/td>\n<\/tr>\n<tr>\n<td>upgradefault.go<\/td>\n<td>\u5347\u7ea7\u5bb9\u9519<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>8.3 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u6587\u4ef6\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>GetPattern()<\/td>\n<td>common.go:72<\/td>\n<td>\u83b7\u53d6\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>LockAllDeviceInfo()<\/td>\n<td>common.go:81<\/td>\n<td>\u9501\u5b9a\u6240\u6709\u8bbe\u5907\u4fe1\u606f&#xff08;\u4e92\u65a5&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>UnlockAllDeviceInfo()<\/td>\n<td>common.go:86<\/td>\n<td>\u89e3\u9501\u8bbe\u5907\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>SetAscendRuntimeEnv()<\/td>\n<td>common.go:91<\/td>\n<td>\u8bbe\u7f6eAscend\u8fd0\u884c\u65f6\u73af\u5883\u53d8\u91cf<\/td>\n<\/tr>\n<tr>\n<td>MakeDataHash()<\/td>\n<td>common.go:131<\/td>\n<td>\u751f\u6210\u6570\u636e\u54c8\u5e0c<\/td>\n<\/tr>\n<tr>\n<td>MarshalData()<\/td>\n<td>common.go:146<\/td>\n<td>\u5e8f\u5217\u5316\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>MapDeepCopy()<\/td>\n<td>common.go:156<\/td>\n<td>Map\u6df1\u62f7\u8d1d<\/td>\n<\/tr>\n<tr>\n<td>GetPodAnnotationByDeviceType()<\/td>\n<td>common.go:168<\/td>\n<td>\u6309\u8bbe\u5907\u7c7b\u578b\u83b7\u53d6Pod\u6ce8\u89e3<\/td>\n<\/tr>\n<tr>\n<td>GetDeviceFromPodAnnotation()<\/td>\n<td>common.go:184<\/td>\n<td>\u4ecePod\u6ce8\u89e3\u83b7\u53d6\u8bbe\u5907<\/td>\n<\/tr>\n<tr>\n<td>GetDefaultDevices()<\/td>\n<td>common.go:212<\/td>\n<td>\u83b7\u53d6\u9ed8\u8ba4\u8bbe\u5907\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>GetDeviceID()<\/td>\n<td>device.go:78<\/td>\n<td>\u89e3\u6790\u8bbe\u5907ID<\/td>\n<\/tr>\n<tr>\n<td>GetSwitchFaultInfo()<\/td>\n<td>device.go:112<\/td>\n<td>\u83b7\u53d6\u4ea4\u6362\u8bbe\u5907\u6545\u969c\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>UpdateSwitchFaultInfoAndFaultLevel()<\/td>\n<td>device.go:157<\/td>\n<td>\u66f4\u65b0\u4ea4\u6362\u8bbe\u5907\u6545\u969c\u7ea7\u522b<\/td>\n<\/tr>\n<tr>\n<td>SetSwitchFaultCode()<\/td>\n<td>device.go:282<\/td>\n<td>\u8bbe\u7f6e\u4ea4\u6362\u8bbe\u5907\u6545\u969c\u7801<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e5d\u3001K8s\u5ba2\u6237\u7aef\u6a21\u5757 \u2014 KubeClient<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034101-6a700dcd3941b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>9.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u5c01\u88c5 Kubernetes API \u4ea4\u4e92\u2014\u2014\u8282\u70b9\u6807\u7b7e\/\u6ce8\u89e3\u7ba1\u7406\u3001ConfigMap CRUD\u3001Pod\u67e5\u8be2\u3001\u8282\u70b9Informer\u3001\u5bb9\u5668\u8fd0\u884c\u65f6\u68c0\u6d4b\u3002<\/p>\n<h4>9.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>kubeclient.go<\/td>\n<td>ClientK8s\u6838\u5fc3\u5ba2\u6237\u7aef<\/td>\n<\/tr>\n<tr>\n<td>kube_connect.go<\/td>\n<td>K8s\u8fde\u63a5\u7ba1\u7406&#xff08;\u914d\u7f6e\u52a0\u8f7d\/\u521b\u5efaClientset&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>kube_cache.go<\/td>\n<td>\u7f13\u5b58\u5c42&#xff08;ConfigMap\/Pod\u7f13\u5b58&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>cur_node_informer.go<\/td>\n<td>\u5f53\u524d\u8282\u70b9Informer&#xff08;\u76d1\u542cPod\u4e8b\u4ef6&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>client_server.go<\/td>\n<td>CRUD\u64cd\u4f5c&#xff08;ConfigMap\/Node Annotation&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>kubeclient_v2.go<\/td>\n<td>A5\u6269\u5c55&#xff08;PingMesh\u914d\u7f6e\u89e3\u6790&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>types.go \/ types_v2.go<\/td>\n<td>\u7c7b\u578b\u5b9a\u4e49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>9.3 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u884c\u53f7\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>NewClientK8s()<\/td>\n<td>68<\/td>\n<td>\u521b\u5efaK8s\u5ba2\u6237\u7aef&#xff08;\u4ece\u73af\u5883\u53d8\u91cf\/in-cluster\u914d\u7f6e\u52a0\u8f7d&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>GetNode()<\/td>\n<td>105<\/td>\n<td>\u83b7\u53d6\u5f53\u524d\u8282\u70b9\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>PatchNodeState()<\/td>\n<td>112<\/td>\n<td>Patch\u8282\u70b9\u72b6\u6001&#xff08;\u6807\u7b7e\/\u6ce8\u89e3&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>AddAnnotation()<\/td>\n<td>122<\/td>\n<td>\u6dfb\u52a0\u8282\u70b9\u6ce8\u89e3<\/td>\n<\/tr>\n<tr>\n<td>GetPod()<\/td>\n<td>147<\/td>\n<td>\u83b7\u53d6\u5355\u4e2aPod<\/td>\n<\/tr>\n<tr>\n<td>PatchPod()<\/td>\n<td>163<\/td>\n<td>Patch Pod<\/td>\n<\/tr>\n<tr>\n<td>GetActivePodList()<\/td>\n<td>169<\/td>\n<td>\u83b7\u53d6\u6d3b\u8dc3Pod\u5217\u8868&#xff08;\u5b57\u6bb5\u9009\u62e9\u5668&#043;\u6821\u9a8c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>GetAllPodList()<\/td>\n<td>183<\/td>\n<td>\u83b7\u53d6\u5168\u90e8Pod\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>getPodListByCondition()<\/td>\n<td>198<\/td>\n<td>\u6309\u6761\u4ef6\u83b7\u53d6Pod\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>GetContainerRuntime()<\/td>\n<td>211<\/td>\n<td>\u83b7\u53d6\u5bb9\u5668\u8fd0\u884c\u65f6\u7c7b\u578b&#xff08;Docker\/Containerd&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>CreateConfigMap()<\/td>\n<td>255<\/td>\n<td>\u521b\u5efaConfigMap<\/td>\n<\/tr>\n<tr>\n<td>GetConfigMap()<\/td>\n<td>270<\/td>\n<td>\u83b7\u53d6ConfigMap<\/td>\n<\/tr>\n<tr>\n<td>UpdateConfigMap()<\/td>\n<td>282<\/td>\n<td>\u66f4\u65b0ConfigMap<\/td>\n<\/tr>\n<tr>\n<td>resetNodeAnnotations()<\/td>\n<td>295<\/td>\n<td>\u91cd\u7f6e\u8282\u70b9\u6ce8\u89e3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u5341\u3001\u91cd\u590d\u8bbe\u5907\u68c0\u6d4b\u6a21\u5757 \u2014 DuplicateDetector<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034101-6a700dcdeefd9.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>10.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u68c0\u6d4b\u540c\u4e00NPU\u8bbe\u5907\u88ab\u591a\u4e2a\u5bb9\u5668\u91cd\u590d\u6302\u8f7d\u7684\u5f02\u5e38\u60c5\u51b5&#xff0c;\u652f\u6301Docker\u548cContainerd\u4e24\u79cd\u5bb9\u5668\u8fd0\u884c\u65f6\u3002<\/p>\n<h4>10.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>manager.go<\/td>\n<td>Manager \u2014 \u68c0\u6d4b\u7ba1\u7406\u5668&#xff08;\u542f\u52a8\/\u626b\u63cf\/\u4e8b\u4ef6\u76d1\u542c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>cache\/container_cache.go<\/td>\n<td>ContainerCache \u2014 \u5bb9\u5668\u7f13\u5b58 &#043; \u91cd\u590d\u68c0\u6d4b\u7b97\u6cd5<\/td>\n<\/tr>\n<tr>\n<td>containerruntime\/interface.go<\/td>\n<td>Client\u63a5\u53e3 &#043; OCI\u7aef\u70b9\u63a2\u6d4b<\/td>\n<\/tr>\n<tr>\n<td>containerruntime\/docker_client.go<\/td>\n<td>Docker\u5ba2\u6237\u7aef\u5b9e\u73b0<\/td>\n<\/tr>\n<tr>\n<td>containerruntime\/containerd_client.go<\/td>\n<td>Containerd\u5ba2\u6237\u7aef\u5b9e\u73b0<\/td>\n<\/tr>\n<tr>\n<td>types\/types.go<\/td>\n<td>\u6570\u636e\u7c7b\u578b\u5b9a\u4e49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>10.3 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u884c\u53f7\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>CheckDuplicateDevices()<\/td>\n<td>39<\/td>\n<td>\u5165\u53e3\u51fd\u6570&#xff0c;\u521b\u5efaManager\u5e76\u542f\u52a8\u68c0\u6d4b<\/td>\n<\/tr>\n<tr>\n<td>NewManager()<\/td>\n<td>62<\/td>\n<td>\u521b\u5efa\u68c0\u6d4b\u7ba1\u7406\u5668&#xff08;\u521d\u59cb\u5316\u7f13\u5b58&#043;\u8fd0\u884c\u65f6\u5ba2\u6237\u7aef&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Start()<\/td>\n<td>79<\/td>\n<td>\u542f\u52a8\u68c0\u6d4b&#xff1a;\u5168\u91cf\u626b\u63cf &#043; \u4e8b\u4ef6\u76d1\u542c<\/td>\n<\/tr>\n<tr>\n<td>watchContainerEvents()<\/td>\n<td>98<\/td>\n<td>\u76d1\u542c\u5bb9\u5668\u521b\u5efa\/\u9500\u6bc1\u4e8b\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>scanAllContainers()<\/td>\n<td>115<\/td>\n<td>\u5168\u91cf\u626b\u63cf\u6240\u6709\u5bb9\u5668\u8bbe\u5907\u6302\u8f7d<\/td>\n<\/tr>\n<tr>\n<td>HandleNewContainer()<\/td>\n<td>131<\/td>\n<td>\u5904\u7406\u65b0\u5bb9\u5668&#xff1a;\u89e3\u6790\u8bbe\u5907\u6302\u8f7d &#043; \u68c0\u6d4b\u91cd\u590d<\/td>\n<\/tr>\n<tr>\n<td>HandleContainerRemoval()<\/td>\n<td>165<\/td>\n<td>\u5904\u7406\u5bb9\u5668\u9500\u6bc1&#xff1a;\u6e05\u7406\u7f13\u5b58<\/td>\n<\/tr>\n<tr>\n<td>logDuplicate()<\/td>\n<td>170<\/td>\n<td>\u8bb0\u5f55\u91cd\u590d\u68c0\u6d4b\u544a\u8b66\u65e5\u5fd7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>10.4 \u68c0\u6d4b\u6d41\u7a0b<\/h4>\n<p>1. CheckDuplicateDevices() \u5165\u53e3<br \/>\n   \u2193<br \/>\n2. NewManager() \u2192 NewContainerCache() \u2192 NewClient()<br \/>\n   \u2193<br \/>\n3. Start()<br \/>\n   \u251c\u2500\u2500 scanAllContainers() (\u5168\u91cf\u626b\u63cf)<br \/>\n   \u2502   \u251c\u2500\u2500 \u89e3\u6790\u6240\u6709\u5bb9\u5668\u8bbe\u5907\u6302\u8f7d\u4fe1\u606f<br \/>\n   \u2502   \u251c\u2500\u2500 StoreAllAndFindDuplicates() (\u6279\u91cf\u5b58\u50a8&#043;\u68c0\u6d4b)<br \/>\n   \u2502   \u2514\u2500\u2500 logDuplicate() (\u544a\u8b66)<br \/>\n   \u2514\u2500\u2500 watchContainerEvents() (\u589e\u91cf\u76d1\u542c)<br \/>\n       \u251c\u2500\u2500 HandleNewContainer() (\u5bb9\u5668\u521b\u5efa \u2192 \u89e3\u6790&#043;\u68c0\u6d4b)<br \/>\n       \u2514\u2500\u2500 HandleContainerRemoval() (\u5bb9\u5668\u9500\u6bc1 \u2192 \u6e05\u7406\u7f13\u5b58)<\/p>\n<hr \/>\n<h3>\u5341\u4e00\u3001\u62d3\u6251\u6a21\u5757 \u2014 Topology<\/h3>\n<h4>11.1 \u6838\u5fc3\u4f5c\u7528<\/h4>\n<p>\u7ba1\u7406\u62d3\u6251\u6587\u4ef6\u7684\u8bfb\u5199\u3001Rack\u62d3\u6251\u4fe1\u606f\u91c7\u96c6&#xff0c;\u652f\u6301\u6587\u4ef6\u54c8\u5e0c\u6821\u9a8c\u786e\u4fdd\u6570\u636e\u5b8c\u6574\u6027\u3002<\/p>\n<h4>11.2 \u6587\u4ef6\u7ed3\u6784<\/h4>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>topo.go<\/td>\n<td>\u62d3\u6251\u6587\u4ef6\u8bfb\u5199\u3001\u54c8\u5e0c\u6821\u9a8c<\/td>\n<\/tr>\n<tr>\n<td>types.go<\/td>\n<td>\u62d3\u6251\u6570\u636e\u7c7b\u578b\u5b9a\u4e49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>11.3 \u5173\u952e\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u884c\u53f7\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>topoFileToStr()<\/td>\n<td>53<\/td>\n<td>\u8bfb\u53d6\u62d3\u6251\u6587\u4ef6\u5185\u5bb9\u4e3a\u5b57\u7b26\u4e32<\/td>\n<\/tr>\n<tr>\n<td>getFileHash()<\/td>\n<td>66<\/td>\n<td>\u8ba1\u7b97\u6587\u4ef6SHA256\u54c8\u5e0c&#xff08;\u5b8c\u6574\u6027\u6821\u9a8c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ToFile()<\/td>\n<td>75<\/td>\n<td>\u5c06\u62d3\u6251\u4fe1\u606f\u5199\u5165\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u5341\u4e8c\u3001\u6a21\u5757\u95f4\u8c03\u7528\u5173\u7cfb\u4e0e\u6570\u636e\u6d41<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034102-6a700dceb05ad.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>12.1 \u4e3b\u8c03\u7528\u94fe<\/h4>\n<p>main.go<br \/>\n  \u2192 DeviceFactory.InitFunction()<br \/>\n    \u2192 DeviceFactory.initDevManager()<br \/>\n      \u2192 DCMI AutoInit() (CGO\u9a71\u52a8\u521d\u59cb\u5316)<br \/>\n      \u2192 NewHwAscend910\/310\/310PManager()<br \/>\n      \u2192 InitSwitchDev()<br \/>\n      \u2192 NewHwDevManager()<br \/>\n        \u2192 setAscendManager() (\u6309\u7c7b\u578b\u8bbe\u7f6eManager)<br \/>\n        \u2192 setAllDeviceAndType()<br \/>\n        \u2192 initPluginServer()<br \/>\n        \u2192 ListenDevice()<br \/>\n          \u251c\u2500\u2500 Serve() \u2192 gRPC Server<br \/>\n          \u2502   \u251c\u2500\u2500 ListAndWatch() \u2192 Device.GetNPUs() \u2192 DCMI<br \/>\n          \u2502   \u2514\u2500\u2500 Allocate() \u2192 Device\u8bbe\u5907\u6302\u8f7d \u2192 \u5bb9\u5668<br \/>\n          \u251c\u2500\u2500 subscribeNpuFaultEvent() \u2192 DCMI\u6545\u969c\u56de\u8c03<br \/>\n          \u251c\u2500\u2500 pollFaultCodeCM() \u2192 KubeClient.GetConfigMap()<br \/>\n          \u2514\u2500\u2500 ticker \u2192 reportDeviceInfo()<br \/>\n              \u2192 Device.UpdateNodeDeviceInfo()<br \/>\n              \u2192 KubeClient.UpdateConfigMap()<\/p>\n<h4>12.2 \u6570\u636e\u4f20\u9012\u77e9\u9635<\/h4>\n<table>\n<tr>\u6570\u636e\u6765\u6e90\u53bb\u5411\u8f7d\u4f53<\/tr>\n<tbody>\n<tr>\n<td>Flag\u914d\u7f6e<\/td>\n<td>\u547d\u4ee4\u884c<\/td>\n<td>main.go \u2192 DeviceFactory<\/td>\n<td>flag.* \u6307\u9488<\/td>\n<\/tr>\n<tr>\n<td>Manager\u5b9e\u4f8b<\/td>\n<td>DeviceFactory<\/td>\n<td>Server\u5c42<\/td>\n<td>HwDevManager \u7ed3\u6784\u4f53<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u5217\u8868<\/td>\n<td>DCMI\u9a71\u52a8<\/td>\n<td>Server \u2192 kubelet<\/td>\n<td>gRPC ListAndWatchResponse<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u5206\u914d<\/td>\n<td>kubelet<\/td>\n<td>Device\u5c42 \u2192 \u5bb9\u5668<\/td>\n<td>gRPC AllocateResponse (Mount)<\/td>\n<\/tr>\n<tr>\n<td>\u6545\u969c\u4e8b\u4ef6<\/td>\n<td>DCMI\u56de\u8c03<\/td>\n<td>Server \u2192 K8s Event<\/td>\n<td>allFaultInfo channel<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u4fe1\u606f<\/td>\n<td>Device\u5c42<\/td>\n<td>KubeClient \u2192 K8s<\/td>\n<td>ConfigMap<\/td>\n<\/tr>\n<tr>\n<td>\u8282\u70b9\u6807\u7b7e<\/td>\n<td>Server<\/td>\n<td>KubeClient \u2192 K8s<\/td>\n<td>Node Annotation\/Label<\/td>\n<\/tr>\n<tr>\n<td>\u5bb9\u5668\u4fe1\u606f<\/td>\n<td>Docker\/Containerd<\/td>\n<td>DuplicateDetector<\/td>\n<td>Container API<\/td>\n<\/tr>\n<tr>\n<td>\u62d3\u6251\u4fe1\u606f<\/td>\n<td>Topology<\/td>\n<td>Server \u2192 K8s<\/td>\n<td>Node Label (topology)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>12.3 \u6838\u5fc3\u6570\u636e\u6d41<\/h4>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     gRPC      \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 kubelet  \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192 \u2502 PluginServer \u2502<br \/>\n\u2502          \u2502 \u2190\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502              \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  ListAndWatch  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                                   \u2502<br \/>\n                          GetNPUs()\u2502<br \/>\n                                   \u2193<br \/>\n                           \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n                           \u2502   Device\u5c42   \u2502<br \/>\n                           \u2502  (910\/310\/   \u2502<br \/>\n                           \u2502   310P)      \u2502<br \/>\n                           \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                                   \u2502<br \/>\n                             CGO  \u2502<br \/>\n                                   \u2193<br \/>\n                           \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n                           \u2502  DCMI \u9a71\u52a8\u5e93  \u2502<br \/>\n                           \u2502 (libdcmi.so) \u2502<br \/>\n                           \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  ConfigMap   \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 K8s API  \u2502 \u2190\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502 KubeClient   \u2502<br \/>\n\u2502 Server   \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192 \u2502              \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  Get\/Patch   \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                                  \u2502<br \/>\n                                   \u2191<br \/>\n                           \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n                           \u2502 PluginServer \u2502 \u2192 ticker\u5b9a\u65f6\u66f4\u65b0<br \/>\n                           \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<hr \/>\n<h3>\u5341\u4e09\u3001\u56fe\u8868\u7d22\u5f15<\/h3>\n<table>\n<tr>\u7f16\u53f7\u56fe\u8868\u540d\u79f0\u6587\u4ef6\u7c7b\u578b<\/tr>\n<tbody>\n<tr>\n<td>a01<\/td>\n<td>\u7cfb\u7edf\u6574\u4f53\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a01_system_architecture.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a02<\/td>\n<td>\u6a21\u5757\u5212\u5206\u4e0e\u4f9d\u8d56\u5173\u7cfb\u56fe<\/td>\n<td>diagrams\/a02_module_dependency.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a03<\/td>\n<td>main.go \u542f\u52a8\u6d41\u7a0b\u56fe<\/td>\n<td>diagrams\/a03_main_startup_flow.png<\/td>\n<td>\u6d41\u7a0b\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a04<\/td>\n<td>Server \u6a21\u5757\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a04_server_module.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a05<\/td>\n<td>Device \u6a21\u5757\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a05_device_module.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a06<\/td>\n<td>Common \u6a21\u5757\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a06_common_module.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a07<\/td>\n<td>KubeClient \u6a21\u5757\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a07_kubeclient_module.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a08<\/td>\n<td>DuplicateDetector \u6a21\u5757\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a08_duplicatedetector_module.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a09<\/td>\n<td>DeviceFactory \u6a21\u5757\u67b6\u6784\u56fe<\/td>\n<td>diagrams\/a09_devicefactory_module.png<\/td>\n<td>\u67b6\u6784\u56fe<\/td>\n<\/tr>\n<tr>\n<td>a10<\/td>\n<td>\u6a21\u5757\u95f4\u6570\u636e\u6d41\u56fe<\/td>\n<td>diagrams\/a10_data_flow.png<\/td>\n<td>\u6570\u636e\u6d41\u56fe<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 \u6e90\u7801\u8def\u5f84: mind-cluster-v26.0.1\/component\/ascend-device-plugin \u5206\u6790\u65e5\u671f: 2026-07-31 \u6587\u4ef6\u7edf\u8ba1: 52\u4e2a\u975e\u6d4b\u8bd5Go\u6e90\u6587\u4ef6&#xff0c;\u7ea620,000\u884c\u4ee3\u7801 \u5236\u56fe\u5de5\u5177: fireworks-tech-graph (Style 1: Flat Icon) \u76ee\u5f55<br \/>\n\u9879\u76ee\u6574\u4f53\u67b6\u6784\u4e0e\u8bbe\u8ba1\u601d\u8def\u6574\u4f53\u8fd0\u884c\u6d41\u7a0b\u5b50\u6a21\u5757\u5212\u5206\u603b\u89c8\u5165\u53e3\u5c42\u6a21\u5757 \u2014 main.go\u5de5\u5382\u5c42\u6a21\u5757 \u2014 D<\/p>\n","protected":false},"author":2,"featured_media":89627,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[120,69,763,121,188],"topic":[],"class_list":["post-89637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-kubernetes","tag-npu","tag-763","tag-121","tag-188"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/89637.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 \u6e90\u7801\u8def\u5f84: mind-cluster-v26.0.1\/component\/ascend-device-plugin \u5206\u6790\u65e5\u671f: 2026-07-31 \u6587\u4ef6\u7edf\u8ba1: 52\u4e2a\u975e\u6d4b\u8bd5Go\u6e90\u6587\u4ef6&#xff0c;\u7ea620,000\u884c\u4ee3\u7801 \u5236\u56fe\u5de5\u5177: fireworks-tech-graph (Style 1: Flat Icon) \u76ee\u5f55 \u9879\u76ee\u6574\u4f53\u67b6\u6784\u4e0e\u8bbe\u8ba1\u601d\u8def\u6574\u4f53\u8fd0\u884c\u6d41\u7a0b\u5b50\u6a21\u5757\u5212\u5206\u603b\u89c8\u5165\u53e3\u5c42\u6a21\u5757 \u2014 main.go\u5de5\u5382\u5c42\u6a21\u5757 \u2014 D\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89637.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-03T03:41:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034055-6a700dc7b6f1b.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89637.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89637.html\",\"name\":\"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-03T03:41:04+00:00\",\"dateModified\":\"2026-08-03T03:41:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89637.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89637.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89637.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/89637.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 \u6e90\u7801\u8def\u5f84: mind-cluster-v26.0.1\/component\/ascend-device-plugin \u5206\u6790\u65e5\u671f: 2026-07-31 \u6587\u4ef6\u7edf\u8ba1: 52\u4e2a\u975e\u6d4b\u8bd5Go\u6e90\u6587\u4ef6&#xff0c;\u7ea620,000\u884c\u4ee3\u7801 \u5236\u56fe\u5de5\u5177: fireworks-tech-graph (Style 1: Flat Icon) \u76ee\u5f55 \u9879\u76ee\u6574\u4f53\u67b6\u6784\u4e0e\u8bbe\u8ba1\u601d\u8def\u6574\u4f53\u8fd0\u884c\u6d41\u7a0b\u5b50\u6a21\u5757\u5212\u5206\u603b\u89c8\u5165\u53e3\u5c42\u6a21\u5757 \u2014 main.go\u5de5\u5382\u5c42\u6a21\u5757 \u2014 D","og_url":"https:\/\/www.wsisp.com\/helps\/89637.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-03T03:41:04+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260803034055-6a700dc7b6f1b.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/89637.html","url":"https:\/\/www.wsisp.com\/helps\/89637.html","name":"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-03T03:41:04+00:00","dateModified":"2026-08-03T03:41:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89637.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89637.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89637.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010NPU\u3011Ascend Device Plugin \u7cfb\u7edf\u7ea7\u67b6\u6784\u5206\u6790"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=89637"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89637\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/89627"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89637"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}