当前位置:   article > 正文

传送门=--_package 'isaacgym' requires a different python: 3.

package 'isaacgym' requires a different python: 3.10.14 not in '<3.9,>=3.6

[Error] [carb.gym.plugin] Gym cuda error: invalid resource handle

教程

[Error] [carb.gym.plugin] Error creating viewer: Sim->Graphics is nullptr

RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)

宇树科技教程:https://support.unitree.com/home/zh/developer/rl_example
源码:https://github.com/unitreerobotics

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 # -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 1

更正版本:

pip install torch==2.2.1+cu116 torchvision==0.17.1+cu116 torchaudio==2.2.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
  • 1

怀疑可以torchaudio改成cu116
是可以的~
但cuda也要装成11.6版本,见笔者blog
之后一个里程碑完结撒花~
在这里插入图片描述

cudatoolkit简介

CUDAToolkit是一个用于GPU计算的软件开发工具包。它由NVIDIA开发,提供了一组CUDA编程模型的库、工具和文档,使开发者能够利用NVIDIA的GPU进行并行计算。
CUDA是一种并行计算平台和编程模型,可以通过在GPU上执行计算任务来加速应用程序。CUDAToolkit包含了用于编译、优化和调试CUDA代码的工具,以及大量的GPU加速库,如线性代数、图像处理和机器学习库等。
使用CUDAToolkit,开发者可以利用GPU的大规模并行计算能力,加速各种应用程序,包括科学计算、数据分析、深度学习等。CUDAToolkit支持多种编程语言,如C、C++、Python和Fortran,开发者可以选择最适合自己的编程语言进行GPU编程。
总之,CUDAToolkit是一个用于GPU计算的软件开发工具包,可以提供丰富的GPU加速库和工具,帮助开发者利用GPU进行并行计算加速。

不用cudatoolkit,只有torch也能加载tensor到GPU

在这里插入图片描述在cudatoolkit11.6的加持下,使用pytorch+cuda11.6可以加速GPU计算。

AttributeError: module ‘distutils’ has no attribute ‘version’

在这里插入图片描述solution:

pip install setuptools==59.5.0
  • 1

askubuntu forum

ImportError: /home/flower/miniconda3/envs/rl-go2/bin/…/lib/libstdc++.so.6: version `GLIBCXX_3.4.32’ not found’

查找指定版本的gcc

strings /home/flowr/miniconda3/envs/rl-go2/lib/libstdc++.so.6  | grep GLIBCXX_3.4.32
  • 1

在这里插入图片描述发现libstdc++.so.6中缺少3.4.32版本,需要更新该libstdc++.so.6文件。

locate / "libstdc++.so.6"
  • 1

查找根目录下的“libstdc++.so.6"文件
在这里插入图片描述看看别的libstdc++.so.6是否包含

strings /home/flowr/miniconda3/envs/rl-go2/lib/libstdc++.so.6  | grep GLIBCXX_3.4.32  | grep GLIBCXX_3.4.32
  • 1

没有

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6  | grep GLIBCXX_3.4.32  | grep GLIBCXX_3.4.32
  • 1

在这里插入图片描述有了(之前按ubuntu ask question的教程更新了)

sudo apt-get install libstdc++6
sudo add-apt-repository ppa:ubuntu-toolchain-r/test 
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
  • 1
  • 2
  • 3
  • 4
  • 5

我们只要把它复制到目标目录下即可

sudo cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/flowr/miniconda3/envs/rl-go2/lib/libstdc++.so.6
  • 1

复制完成
在这里插入图片描述该bug解决,

  • conda虚拟环境下pip install tensorboardconda install tensorboard效果一致。

未解决

https://www.cnblogs.com/Q-M-double-j/p/18102664
更新:换成如下配置,仍然报错
在这里插入图片描述在这里插入图片描述
声明:虚拟环境下GPU和CUDA(11.1)正常
在这里插入图片描述python,torch,cudatoolkit,cuda,nvidia drive的版本如下:
在这里插入图片描述在这里插入图片描述CUDA向后兼容:可以兼容较早版本的其他软件(cudatoolkit)


执行isaacgym/python/examples/jointed_monkey.py,CPU可以正常跑,
在这里插入图片描述


指定为GPU,
在这里插入图片描述
在下述代码之前正常:

# joint animation states
ANIM_SEEK_LOWER = 1
ANIM_SEEK_UPPER = 2
ANIM_SEEK_DEFAULT = 3
ANIM_FINISHED = 4

# initialize animation state
anim_state = ANIM_SEEK_LOWER
current_dof = 0
print("Animating DOF %d ('%s')" % (current_dof, dof_names[current_dof]))

while not gym.query_viewer_has_closed(viewer):

    # step the physics
    gym.simulate(sim)
    gym.fetch_results(sim, True)

    speed = speeds[current_dof]

    # animate the dofs
    if anim_state == ANIM_SEEK_LOWER:
        dof_positions[current_dof] -= speed * dt
        if dof_positions[current_dof] <= lower_limits[current_dof]:
            dof_positions[current_dof] = lower_limits[current_dof]
            anim_state = ANIM_SEEK_UPPER
    elif anim_state == ANIM_SEEK_UPPER:
        dof_positions[current_dof] += speed * dt
        if dof_positions[current_dof] >= upper_limits[current_dof]:
            dof_positions[current_dof] = upper_limits[current_dof]
            anim_state = ANIM_SEEK_DEFAULT
    if anim_state == ANIM_SEEK_DEFAULT:
        dof_positions[current_dof] -= speed * dt
        if dof_positions[current_dof] <= defaults[current_dof]:
            dof_positions[current_dof] = defaults[current_dof]
            anim_state = ANIM_FINISHED
    elif anim_state == ANIM_FINISHED:
        dof_positions[current_dof] = defaults[current_dof]
        current_dof = (current_dof + 1) % num_dofs
        anim_state = ANIM_SEEK_LOWER
        print("Animating DOF %d ('%s')" % (current_dof, dof_names[current_dof]))

    if args.show_axis:
        gym.clear_lines(viewer)

    # clone actor state in all of the environments
    for i in range(num_envs):
        gym.set_actor_dof_states(envs[i], actor_handles[i], dof_states, gymapi.STATE_POS)

        if args.show_axis:
            # get the DOF frame (origin and axis)
            dof_handle = gym.get_actor_dof_handle(envs[i], actor_handles[i], current_dof)
            frame = gym.get_dof_frame(envs[i], dof_handle)

            # draw a line from DOF origin along the DOF axis
            p1 = frame.origin
            p2 = frame.origin + frame.axis * 0.7
            color = gymapi.Vec3(1.0, 0.0, 0.0)
            gymutil.draw_line(p1, p2, color, gym, viewer, envs[i])
    import pdb; pdb.set_trace()
    
    # update the viewer
    gym.step_graphics(sim)
    gym.draw_viewer(viewer, sim, True)

    # Wait for dt to elapse in real time.
    # This synchronizes the physics simulation with the rendering rate.
    gym.sync_frame_time(sim)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67

不能获取自由度
在这里插入图片描述而且终端报错如下:
在这里插入图片描述GPU显存没有过载,因为环境数目=1一样报错。

已解决

7/3

nvidia isaac gym教程:
https://www.nvidia.com/en-us/on-demand/search/?facet.mimetype[]=event%20session&layout=list&page=1&q=isaac%20gym&sort=relevance&sortDir=desc

执行错误:

internal error : PhysX Internal CUDA error. Simulation cannot continue!
  • 1

link

7/2

ERROR: Package 'isaacgym' requires a different Python: 3.12.3 not in '<3.9,>=3.6'
  • 1
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pysdf
  • 1
  • 2
ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
  • 1

配环境,卒

pip show isaacgym
  • 1

在这里插入图片描述```sh
python3

![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/8157811ccdc64495ae73392843a1b5c6.png)
* 要用conda 执行xxx.sh
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/990595
推荐阅读
相关标签
  

闽ICP备14008679号