ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# :-: xgboost复现解决步骤 | 适用范围 | 适用版本 | 人员 | 发布时间 | 文档版本 |备注 | | --- | --- | --- | --- | --- |--- | | 服务器操作系统 | V10-SP1 | 王国武 |2022.3.23| V1.0|发布| | 服务器操作系统 | V10-SP1 | 张志勇 |2022.3.23| V1.1|模板调整| ***** ## 1. 问题环境复现 | 硬件环境 | 软件环境 | 第三方软件 | | --- | --- | --- | | Taishan200 | 银河麒麟高级服务器操作系统V10 SP1 0711 | GoldenData HD | | 如有特殊配置需列出 | 内核号:4.19.90-17.ky10.aarch64 | Spark2.4.3 | | 主机/虚拟机 | 主机 | Xgboost0.90 | | 网络环境 | | | ## 2. 问题描述及复现步骤 ### 2.1 问题描述 测试环境中进行AI平台mole工具测试,在spark分散的各节点无法执行xgboost,执行xgboost底层运行调c++,发现缺库,然后报错。 ![](https://img.kancloud.cn/1a/26/1a26fc848d7b037dbec0fba0da92a057_554x71.png) ### 2.2 复现步骤 搭建环境 安装java-1.8.0-openjdk-devel-1.8.0.242.b08-1.h5.ky10.aarch64.rpm `rpm -ivh java-1.8.0-openjdk-devel-1.8.0.242.b08-1.h5.ky10.aarch64.rpm` 把csv.tar.gz解压到/root目录下 `cd /root` `tar xvf csv.tar.gz` `[root@localhost xcc]# tar xvf demo.tar.gz` `[root@localhost xcc]# cd demo` `[root@localhost demo]# ./mvnw clean package` `[root@localhost demo]# java -jar ./target/demo-0.0.1-SNAPSHOT.jar` 出现can't load AMD 64-bit .so on a AARCH64-bit platform错误 ![](https://img.kancloud.cn/77/31/7731b107ca5e0f2cb85abb19163e893f_540x231.png) ### 2.3 解决方案: 问题定位分析: 由于xgboost4j没有AARCH64平台的libxgboost4j.so库,查找xgboost-0.90.jar文件,需要用到libxgboost4j.so,因此需要重新编译xgboost来生成AARCH64平台下的libxgboost4j.so,解决这个缺少库的错误。 在arm平台上重新编译xgboost4j, 把编译好的xgboost4j-0.90.jar包放到本地maven源中 `[root@localhost xcc]# cd demo` `[root@localhost xcc]# ./mvnw install:install-file -Dfile=/root/xgboost4j-0.90.jar -DgroupId=ml.dmlc -DartifactId=xgboost4j -Dversion=0.90 -Dpackaging=jar` 参数说明: -Dfile对于你的jar包的位置 -DgroupId -DartifactId -Dversion三个参数分别对于demo的pom.xml文件中的配置参数选项 ![](https://img.kancloud.cn/8e/99/8e996af031b9c55416129da96495a62e_554x187.png) 重新编译demo `[root@localhost xcc]# cd demo` `[root@localhost demo]# ./mvnw clean package` ![](https://img.kancloud.cn/c3/5e/c35ec16a3fc4e41d8ef6072e24f26b83_554x158.png) `[root@localhost demo]# java -jar ./target/demo-0.0.1-SNAPSHOT.jar` ![](https://img.kancloud.cn/fb/dc/fbdc2515061556bdca21c98004eecf71_554x131.png) 运行成功