weixin_39599830
weixin_39599830
2020-12-09 07:33

OSX Hugepages

Thank you for awesome work mate.

OSX compile works (after some minor amendments).

JFYI: Your improvements probably break hugepages on OSX as they are showing as "Available" but "Disabled". Restart, sudo cannot help. Clean XMRig works good here incl. Hugepages... I'm not able to figure out what can be wrong.

该提问来源于开源项目:Bendr0id/xmrigCC

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39987120 weixin_39987120 5月前

    Sorry to hear that. It could be that OSX needs the memory aligned in 2MB chunks like windows does.

    Could you please try to change Mem_unix.cpp from this:

    
    #   if defined(__APPLE__)
        m_memory = static_cast<uint8_t>(mmap(0, m_memorySize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, VM_FLAGS_SUPERPAGE_SIZE_2MB, 0));
    #   elif defined(__FreeBSD__)
    </uint8_t>

    to this:

    
    #   if defined(__APPLE__)
        m_memorySize = m_memorySize - (m_memorySize % MEMORY) + MEMORY;
        m_memory = static_cast<uint8_t>(mmap(0, m_memorySize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, VM_FLAGS_SUPERPAGE_SIZE_2MB, 0));
    #   elif defined(__FreeBSD__)
    </uint8_t>
    点赞 评论 复制链接分享
  • weixin_39599830 weixin_39599830 5月前

    Hello Bendr0id,

    I can confirm that above solution works. Successfully tested on several Macs... Thank you!

    Solved...

    点赞 评论 复制链接分享
  • weixin_39599830 weixin_39599830 5月前

    Sorry for reopening this and it's not exactly about hugepages but also "memory-related"... I trying to recompile 1.5.1 but getting error with unspecified definition of "alignas" on Mem.h <-> Mem.cpp. Not sure where should be the problem as Linux build was OK though (this should not be platform specific, right?). Source code is unmodified, GCC 7.3.0_1 through homebrew, TLS+Server+AEON+HTTPD = off. (cmake .. -DWITH_CC_SERVER=OFF -DWITH_HTTPD=OFF -DWITH_AEON=OFF -DWITH_TLS=OFF from subdir). 1.4.0 was also OK (VAR_ALIGN used instead).

    [ 36%] Building CXX object CMakeFiles/xmrig_common.dir/src/Mem.cpp.o /Users/user/xmrigCC_new/src/Mem.cpp:37:15: error: 'alignas' must be specified on definition if it is specified on any declaration uint8_t *Mem::m_memory = nullptr; ^ /Users/user/xmrigCC_new/src/Mem.h:71:5: note: declared with 'alignas' attribute here alignas(16) static uint8_t *m_memory; ^ 1 error generated. make[2]: *** [CMakeFiles/xmrig_common.dir/src/Mem.cpp.o] Error 1 make[1]: *** [CMakeFiles/xmrig_common.dir/all] Error 2 make: *** [all] Error 2

    点赞 评论 复制链接分享
  • weixin_39987120 weixin_39987120 5月前

    Hm don't know, could you try to include:

    
    #include <stddef.h>
    #include <stdint.h>
    </stdint.h></stddef.h>

    instead of

    
    #include <cstddef>
    #include <cstdint>
    </cstdint></cstddef>

    in mem.h

    点赞 评论 复制链接分享
  • weixin_39599830 weixin_39599830 5月前

    70 Fixed. alignas also missing in Mem.cpp. Thank you for help.

    点赞 评论 复制链接分享
  • weixin_39987120 weixin_39987120 5月前

    Hey
    would be awesome if you can update the build instructions for XMRigCC 1.6 for OSX on the Wiki. Please look into the linux build. XMRigCC now needs Boost.

    点赞 评论 复制链接分享
  • weixin_39599830 weixin_39599830 5月前

    Hi ,

    Thanks! Updated!

    Regards...

    点赞 评论 复制链接分享

相关推荐