|
87 | 87 | "outputs": [], |
88 | 88 | "source": [ |
89 | 89 | "# Get and display CPU/platform information\n", |
90 | | - "cpu_info = CPUInfo()\n", |
91 | | - "platform_util = PlatformUtil()\n", |
92 | | - "print(\"{0} CPU Information {0}\".format(\"=\" * 20))\n", |
93 | | - "print(\"CPU family:\", platform_util.cpu_family)\n", |
94 | | - "print(\"CPU model:\", platform_util.cpu_model)\n", |
95 | | - "print(\"CPU type:\", platform_util.cpu_type)\n", |
96 | | - "print(\"Physical cores per socket:\", cpu_info.cores_per_socket)\n", |
97 | | - "print(\"Total physical cores:\", cpu_info.cores)\n", |
98 | | - "cpufreq = psutil.cpu_freq()\n", |
99 | | - "print(\"Max Frequency:\", cpufreq.max)\n", |
100 | | - "print(\"Min Frequency:\", cpufreq.min)\n", |
101 | | - "cpu_socket_count = cpu_info.sockets\n", |
102 | | - "print(\"Socket Number:\", cpu_socket_count)\n", |
| 90 | + "try:\n", |
| 91 | + " cpu_info = CPUInfo()\n", |
| 92 | + " platform_util = PlatformUtil()\n", |
| 93 | + " print(\"{0} CPU Information {0}\".format(\"=\" * 20))\n", |
| 94 | + " print(\"CPU family:\", platform_util.cpu_family)\n", |
| 95 | + " print(\"CPU model:\", platform_util.cpu_model)\n", |
| 96 | + " print(\"CPU type:\", platform_util.cpu_type)\n", |
| 97 | + " print(\"Physical cores per socket:\", cpu_info.cores_per_socket)\n", |
| 98 | + " print(\"Total physical cores:\", cpu_info.cores)\n", |
| 99 | + " cpufreq = psutil.cpu_freq()\n", |
| 100 | + " print(\"Max Frequency:\", cpufreq.max)\n", |
| 101 | + " print(\"Min Frequency:\", cpufreq.min)\n", |
| 102 | + " cpu_socket_count = cpu_info.sockets\n", |
| 103 | + " print(\"Socket Number:\", cpu_socket_count)\n", |
| 104 | + "except Exception as e:\n", |
| 105 | + " print(\"Warning, Unable to parse CPU information. It is recommended to use a Xeon machine. Without a Xeon machine, behavior is unknown\")\n", |
103 | 106 | "\n", |
104 | 107 | "print(\"\\n{0} Memory Information {0}\".format(\"=\" * 20))\n", |
105 | 108 | "svmem = psutil.virtual_memory()\n", |
|
112 | 115 | "\n", |
113 | 116 | "# Display PyTorch version information\n", |
114 | 117 | "print(\"\\n{0} PyTorch Information {0}\".format(\"=\" * 20))\n", |
115 | | - "print(\"PyTorch version:\", torch.__version__)" |
| 118 | + "print(\"PyTorch version:\", torch.__version__)\n" |
116 | 119 | ] |
117 | 120 | }, |
118 | 121 | { |
|
810 | 813 | "name": "python", |
811 | 814 | "nbconvert_exporter": "python", |
812 | 815 | "pygments_lexer": "ipython3", |
813 | | - "version": "3.10.6" |
| 816 | + "version": "3.9.17" |
814 | 817 | } |
815 | 818 | }, |
816 | 819 | "nbformat": 4, |
|
0 commit comments