PHC & Isaac Gym & 远程可视化 安装记录

背景

需求

在远程Ubuntu服务器上运行PHC,在MacOS上可视化。

环境

服务器Ubuntu版本:

lsb_release -a
# 输出
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

MacOS版本: 14.6 (23G80)
已配置好的VSCode,包含Remote-SSH等。

相关软件

  • Isaac Gym:是由NVIDIA开发的开源平台,专为物理模拟和强化学习中的机器人应用设计。本文中是需要进行可视化的对象。
  • VSCode:是微软公司开发的一个轻量级但功能强大的跨平台源代码编辑器。本文中用于远程连接服务器及X11转发。
  • XQuartz:是一个专为Apple Mac OS设计和优化的开源X Window System实现。本文中用于可视化VSCode 转发远程服务器上的 X11 图形界面应用。
  • Royal TSX:是一款适用于macOS的远程连接管理工具。(可能并不需要)

安装步骤

安装XQuartz。在VSCode的ssh config中,在要可视化的远程服务器后添加:

    ForwardX11 yes           # 启用 X11 转发
    ForwardX11Trusted yes    # 信任连接(避免安全提示)
    ForwardAgent yes         # 启用代理转发(可选)

PHC安装步骤见此处

在安装PHC环境的过程中,遇到2. Download and setup Isaac Gym.,开始安装Isaac Gym。

安装Isaac Gym

安装Isaac Gym可以参考6。但是个人在安装过程中遇到多个错误。

  1. Isaac Gym需要Vulkan。参考6安装Vulkan时使用如下命令:
sudo apt-get install cmake git gcc g++ mesa-* libwayland-dev libxrandr-dev
sudo apt-get install libvulkan1 mesa-vulkan-drivers vulkan-utils
vulkaninfo

在第二个install中,遇到E: Unable to locate package vulkan-utils。解决方法为,将sudo apt-get install libvulkan1 mesa-vulkan-drivers vulkan-utils替换为sudo apt-get install libvulkan1 mesa-vulkan-drivers vulkan-tools。(可能是Ubuntu 22.04的问题,不确定20.04是否需要如此替换)
安装好vulkan后,执行vulkaninfo --summary,检查安装情况。

  1. 安装好Isaac Gym与Vulkan后,执行python examples/joint_monkey.py时,输出为:
Importing module 'gym_38' (/home/yifei/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
Traceback (most recent call last):
  File "examples/joint_monkey.py", line 19, in <module>
    from isaacgym import gymapi, gymutil
  File "/home/yifei/Downloads/isaacgym/python/isaacgym/__init__.py", line 5, in <module>
    from isaacgym import gymapi
  File "/home/yifei/Downloads/isaacgym/python/isaacgym/gymapi.py", line 104, in <module>
    _import_active_version()
  File "/home/yifei/Downloads/isaacgym/python/isaacgym/gymapi.py", line 63, in _import_active_version
    module = importlib.import_module(package_path)
  File "/home/yifei/anaconda3/envs/isaac/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

解决办法参考7,修改动态链接库搜索路径。

  1. 在修改动态链接库搜素路径后,在此运行python examples/joint_monkey.py时,输出为:
Importing module 'gym_38' (/home/yifei/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to /home/yifei/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
WARNING: Forcing CPU pipeline.
Not connected to PVD
+++ Using GPU PhysX
Physics Engine: PhysX
Physics Device: cuda:0
GPU Pipeline: disabled
No GPU devices found.
[Error] [carb.gym.plugin] Failed to create Nvf device in createNvfGraphics. Please make sure Vulkan is correctly installed.
*** Failed to create sim

检查Vulkan情况。执行vulkaninfo --summary,输出为:

ERROR: [Loader Message] Code 0 : libGLX_nvidia.so.0: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : /home/yifei/anaconda3/envs/isaac/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-15.so.1)
ERROR: [Loader Message] Code 0 : /home/yifei/anaconda3/envs/isaac/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-15.so.1)
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 2.  Skipping ICD.
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
ERROR at ./vulkaninfo/vulkaninfo.h:230:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED

根据输出,发现错误与/home/yifei/anaconda3/envs/isaac/lib/libstdc++.so.6有关。考虑到修改动态链接库前,无此错误,所以考虑删除虚拟环境下的该库。在虚拟环境目录下执行mv lib/libstdc++.so.6 lib/libstdc++.so.6.bak,再次检查安装情况,则无此报错。

  1. 此时,执行python joint_monkey.py,出现可视化窗口,但是一闪而灭,且伴随如下输出:
Creating 36 environments
Animating DOF 0 ('abdomen_z')
Segmentation fault (core dumped)

vulkaninfo未检测到nvidia gpu。参考8重装显卡驱动即可。

  1. 若遇到libcuda.so相关的问题,可以参考9。不过解决后,并未发现显示速度有提升。

调试PHC可视化代码

运行python scripts/vis/vis_motion_mj.py出现如下错误:

Importing module 'gym_38' (/home/yifei/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to /home/yifei/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
2025-05-08 05:43:21,243 - INFO - logger - logger initialized
MOVING MOTION DATA TO GPU, USING CACHE: False
MOVING MOTION DATA TO GPU, USING CACHE: False
!!!! Using modified SMPL starting pose !!!!
SIM FPS: 30.0

****************************** Current motion keys ******************************
Sampling motion: tensor([0])
standing
*********************************************************************************

100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.66s/it]
0it [00:00, ?it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 25420.02it/s]
Loaded 1 motions with a total length of 33.300s and 1000 frames.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
/home/yifei/anaconda3/envs/isaac_a/lib/python3.8/site-packages/glfw/__init__.py:917: GLFWError: (65543) b'GLX: Failed to create context: BadValue (integer parameter out of range for operation)'
  warnings.warn(message, GLFWError)
ERROR: could not create window

根据10,认为该错误是libstdc++.so.6引起的。回顾安装Isaac Gym的第四步,处理方式可能不对。以

home/yifei/anaconda3/envs/isaac/lib/libstdc++.so.6: version `GLIBCXX_3.4.30’ not found

为关键词搜索,并参考11,解决该问题。但最终仍无效。
输入glxinfo,输出仍为:

name of display: localhost:10.0
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  27
  Current serial number in output stream:  28

参考多篇文章12 13,暂时放弃这条路,转向VNC。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值