尊龙凯时人生就是搏

CoreFreq£ºLinuxϵÄCPUƵÂʼà¿Ø¹¤¾ßÏÈÈÝ

CoreFreq£ºLinuxϵÄCPUƵÂʼà¿Ø¹¤¾ßÏÈÈÝ

ÔÚLinuxϵͳÖÐ £¬¹ØÓÚCPUƵÂʵļà¿ØºÍÖÎÀíÒ»Ö±ÊÇÒ»¸ö½ÏÁ¿Ö÷ÒªµÄʹÃü¡£Í¨¹ý¼à¿ØCPUµÄƵÂÊ £¬ÎÒÃÇ¿ÉÒÔʵʱÏàʶCPUµÄÔËÐÐ״̬ £¬µ÷½âƵÂÊÒÔÌá¸ßÐÔÄÜ»ò½µµÍ¹¦ºÄ¡£ÔÚLinuxϵͳÖÐ £¬ÓÐÐí¶à¹¤¾ß¿ÉÒÔÓÃÀ´¼à¿ØCPUƵÂÊ £¬ÆäÖÐÒ»¸ö½ÏÁ¿ÓÅÒìµÄ¹¤¾ßÊÇCoreFreq¡£±¾ÎĽ«ÏÈÈÝCoreFreq¹¤¾ßµÄ»ù±¾¹¦Ð§ÒÔ¼°ÔõÑùÔÚLinuxϵͳÖÐ×°ÖúÍʹÓÃËü¡£

CoreFreq¼ò½é

CoreFreqÊÇÒ»¸öÕë¶ÔIntelºÍAMD´¦ÀíÆ÷µÄ¸ß¼¶CPUƵÂʼà¿Ø¹¤¾ß £¬Ö¼ÔÚÌṩÏêϸµÄCPUƵÂʺ͹¦ºÄÐÅÏ¢ £¬×ÊÖúÓû§ÓÅ»¯CPUµÄÐÔÄܺ͹¦ºÄ¡£CoreFreqÖ§³Ö¶àÖÖCPU¼Ü¹¹ £¬²¢ÌṩÁ˸»ºñµÄ¹¦Ð§ºÍ²ÎÊýÑ¡Ïî £¬¿ÉÒÔÀû±ãµØ¼à¿ØCPUµÄÐÔÄܺ͹¦ºÄÇéÐΡ£

×°ÖÃCoreFreq

ÔÚLinuxϵͳÖÐ×°ÖÃCoreFreqºÜÊǼòÆÓ £¬¿ÉÒÔͨ¹ý°ü¹ÜÀí¹¤¾ß»òÔ´´úÂë¾ÙÐÐ×°Öá£ÒÔÏÂÊÇʹÓðü¹ÜÀí¹¤¾ß×°ÖÃCoreFreqµÄ°ì·¨£º

¹ØÓÚ»ùÓÚDebianµÄϵͳ£¨ÈçUbuntu£©£º

sudo apt-get update
sudo apt-get install corefreq

µÇ¼ºó¸´ÖÆ

¹ØÓÚ»ùÓÚFedoraµÄϵͳ£º

sudo dnf install corefreq

µÇ¼ºó¸´ÖÆ

¹ØÓÚÆäËû¿¯Ðаæ £¬¿ÉÒÔ´ÓÔ´´úÂë±àÒë×°Öá£Ê×ÏÈÏÂÔØCoreFreqµÄÔ´´úÂë°ü £¬È»ºóÖ´ÐÐÒÔÏÂÏÂÁî¾ÙÐбàÒëºÍ×°Öãº

tar -zxvf CoreFreq-X.X.X.tar.gz
cd CoreFreq-X.X.X
make
sudo make install

µÇ¼ºó¸´ÖÆ

ʹÓÃCoreFreq

×°ÖÃÍê³Éºó £¬¿ÉÒÔͨ¹ýÏÂÁîÐлòͼÐνçÃæÀ´Æô¶¯CoreFreq¡£ÒÔÏÂÊÇһЩ³£ÓõÄÏÂÁîʾÀý£º

Æô¶¯CoreFreqÏÂÁîÐнçÃ棺

sudo corefreq-cli

µÇ¼ºó¸´ÖÆ

Æô¶¯CoreFreqͼÐνçÃ棺

sudo corefreq-gtk

µÇ¼ºó¸´ÖÆ

ʾÀý´úÂë

ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄPython¾ç±¾Ê¾Àý £¬Ê¹ÓÃCoreFreqÌṩµÄAPI»ñÈ¡CPUƵÂÊÐÅÏ¢²¢´òÓ¡³öÀ´£º

import corefreq_api

corefreq_api.init()
corefreq_api.enable_event_sampling()
corefreq_api.start_monitor()

for core in corefreq_api.core_list.values():
    print(f"Core {core.core_id}:")
    for freq in core.freq.values():
        print(f"Frequency: {freq.actual/1000} GHz")

corefreq_api.stop_monitor()
corefreq_api.finish()

µÇ¼ºó¸´ÖÆ

ͨ¹ýÒÔÉÏ´úÂëʾÀý £¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÔõÑùʹÓÃCoreFreqµÄAPIÀ´»ñÈ¡CPUƵÂÊÐÅÏ¢ £¬²¢¶ÔÆä¾ÙÐд¦Àí¡£

×ܽáһϠ£¬CoreFreqÊÇÒ»¸ö¹¦Ð§Ç¿Ê¢µÄLinuxϵÄCPUƵÂʼà¿Ø¹¤¾ß £¬¿ÉÒÔ×ÊÖúÓû§¼à¿ØCPUµÄÐÔÄܺ͹¦ºÄÇéÐΡ£Í¨¹ý±¾ÎĵÄÏÈÈÝ £¬ÐÅÍжÁÕß¿ÉÒÔ¸üºÃµØÏàʶCoreFreqµÄ»ù±¾¹¦Ð§ºÍʹÓÃÒªÁì £¬´Ó¶ø¸üºÃµØ¾ÙÐÐCPUƵÂÊÖÎÀíºÍÓÅ»¯¡£

ÒÔÉϾÍÊÇCoreFreq£ºLinuxϵÄCPUƵÂʼà¿Ø¹¤¾ßÏÈÈݵÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ