[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on depthImage buffer with error 101 运行时报错,请教一下作者,感谢!
- Dominant language
- Python
- Stars
- 381
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
感谢作者们的杰出工作,我想问一下我运行的时候出现以下报错,可能的原因是?已经用preview3了。
我的显卡配置是:sanbens@sanbens-9960x:~$ nvidia-smi
Wed Nov 12 16:30:25 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.190 Driver Version: 570.190 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3090 On | 00000000:01:00.0 Off | N/A |
| 41% 49C P0 115W / 250W | 334MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA GeForce RTX 3090 On | 00000000:11:00.0 On | N/A |
| 32% 35C P8 32W / 250W | 707MiB / 24576MiB | 24% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 2 NVIDIA GeForce RTX 3090 On | 00000000:C1:00.0 Off | N/A |
| 42% 27C P8 18W / 250W | 138MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 3 NVIDIA GeForce RTX 3090 On | 00000000:E1:00.0 Off | N/A |
| 30% 37C P0 110W / 250W | 1661MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
输出为:[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on optical flow buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on rgbImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on depthImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on segmentationImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on optical flow buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on rgbImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on depthImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on segmentationImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on optical flow buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on rgbImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on depthImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on segmentationImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on optical flow buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on rgbImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on depthImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on segmentationImage buffer with error 101
[Error] [carb.gym.plugin] cudaExternamMemoryGetMappedBuffer failed on optical flow buffer with error 101
[Error] [carb.gym.plugin] Gym cuda error: invalid device ordinal: ../../../source/plugins/carb/gym/impl/Gym/GymPhysXCuda.cu: 991
/home/sanbens/miniconda3/envs/WMP/lib/python3.8/site-packages/torch/functional.py:512: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3587.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
'train_cfg' provided -> Ignoring 'name=a1_amp'
Begin construct world model
Encoder CNN shapes: {'image': (64, 64, 1)}
Encoder MLP shapes: {'prop': (33,)}
cnn outdim 4096
mlp outdim 1024
total outdim: 5120
Decoder CNN shapes: {'image': (64, 64, 1)}
Decoder MLP shapes: {'prop': (33,)}
Optimizer model_opt has 25236129 variables.
Finish construct world model
Actor MLP: Sequential(
(0): Linear(in_features=70, out_features=256, bias=True)
(1): ELU(alpha=1.0)
(2): Linear(in_features=256, out_features=128, bias=True)
(3): ELU(alpha=1.0)
(4): Linear(in_features=128, out_features=64, bias=True)
(5): ELU(alpha=1.0)
(6): Linear(in_features=64, out_features=12, bias=True)
)
Critic MLP: Sequential(
(0): Linear(in_features=317, out_features=512, bias=True)
(1): ELU(alpha=1.0)
(2): Linear(in_features=512, out_features=256, bias=True)
(3): ELU(alpha=1.0)
(4): Linear(in_features=256, out_features=128, bias=True)
(5): ELU(alpha=1.0)
(6): Linear(in_features=128, out_features=1, bias=True)
)
Loaded 10.0s. motion from datasets/mocap_motions/hop1.txt.
Loaded 10.0s. motion from datasets/mocap_motions/trot1.txt.
Loaded 10.0s. motion from datasets/mocap_motions/trot2.txt.
Loaded 10.0s. motion from datasets/mocap_motions/hop2.txt.
Preloading 2000000 transitions
Finished preloading
*** Can't create empty tensor
Traceback (most recent call last):
File "legged_gym/scripts/train.py", line 65, in
train(args)
File "legged_gym/scripts/train.py", line 58, in train
ppo_runner.learn(num_learning_iterations=train_cfg.runner.max_iterations, init_at_random_ep_len=True)
File "/home/sanbens/Code/WMP/rsl_rl/runners/wmp_runner.py", line 254, in learn
obs, privileged_obs, rewards, dones, infos, reset_env_ids, terminal_amp_states = self.env.step(
File "/home/sanbens/Code/WMP/legged_gym/envs/base/legged_robot.py", line 180, in step
reset_env_ids, terminal_amp_states = self.post_physics_step()
File "/home/sanbens/Code/WMP/legged_gym/envs/base/legged_robot.py", line 292, in post_physics_step
self.update_depth_buffer()
File "/home/sanbens/Code/WMP/legged_gym/envs/base/legged_robot.py", line 241, in update_depth_buffer
depth_image = self.process_depth_image(depth_image, i)
File "/home/sanbens/Code/WMP/legged_gym/envs/base/legged_robot.py", line 212, in process_depth_image
depth_image += self.cfg.depth.dis_noise * 2 * (torch.rand(1)-0.5)[0]
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'Tensor'
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with legged_gym/envs/base/legged_robot.py, following update_depth_buffer() into process_depth_image(), and compare the logged invalid-device-ordinal and mapped-buffer failures with the GPU information shown by nvidia-smi. Reproduce via legged_gym/scripts/train.py and trace why depth_image is None before noise is applied. Done means training passes this step without the reported CUDA and depth-image errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, machine-learning, robotics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100