mani-skill-nightly 2025.3.19.2322__py3-none-any.whl → 2025.3.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mani_skill/examples/benchmarking/gpu_sim.py +3 -3
- mani_skill/examples/benchmarking/profiling.py +23 -14
- {mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/METADATA +1 -1
- {mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/RECORD +7 -7
- {mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/LICENSE +0 -0
- {mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/WHEEL +0 -0
- {mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/top_level.txt +0 -0
@@ -1,11 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import sys
|
2
2
|
from dataclasses import dataclass
|
3
3
|
from pathlib import Path
|
4
4
|
from typing import Annotated, Optional
|
5
5
|
import gymnasium as gym
|
6
6
|
import numpy as np
|
7
7
|
import torch
|
8
|
-
import tqdm
|
9
8
|
import tyro
|
10
9
|
|
11
10
|
import mani_skill.envs
|
@@ -81,7 +80,8 @@ def main(args: Args):
|
|
81
80
|
env = CPUGymWrapper(env, )
|
82
81
|
return env
|
83
82
|
return _init
|
84
|
-
|
83
|
+
# mac os system does not work with forkserver when using visual observations
|
84
|
+
env = AsyncVectorEnv([make_env() for _ in range(num_envs)], context="forkserver" if sys.platform == "darwin" else None) if args.num_envs > 1 else make_env()()
|
85
85
|
base_env = make_env()().unwrapped
|
86
86
|
|
87
87
|
base_env.print_sim_details()
|
@@ -31,14 +31,19 @@ class Profiler:
|
|
31
31
|
self.output_format = output_format
|
32
32
|
self.synchronize_torch = synchronize_torch
|
33
33
|
self.stats = dict()
|
34
|
+
|
34
35
|
# Initialize NVML
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
self._gpu_handle = None
|
37
|
+
try:
|
38
|
+
pynvml.nvmlInit()
|
39
|
+
# Get handle for the first GPU (index 0)
|
40
|
+
self._gpu_handle = pynvml.nvmlDeviceGetHandleByIndex(0)
|
41
|
+
except pynvml.NVMLError_LibraryNotFound as e:
|
42
|
+
print(f"NVML could not be initialized for pynvml: {e}. Not tracking GPU memory anymore.")
|
39
43
|
|
40
44
|
# Get the PID of the current process
|
41
45
|
self.current_pid = os.getpid()
|
46
|
+
self._torch_cuda_available = torch.cuda.is_available()
|
42
47
|
|
43
48
|
def log(self, msg):
|
44
49
|
"""log a message to stdout"""
|
@@ -88,7 +93,8 @@ class Profiler:
|
|
88
93
|
process = psutil.Process(os.getpid())
|
89
94
|
cpu_mem_use = process.memory_info().rss
|
90
95
|
gpu_mem_use = self.get_current_process_gpu_memory()
|
91
|
-
|
96
|
+
if self._torch_cuda_available:
|
97
|
+
torch.cuda.synchronize()
|
92
98
|
stime = time.time()
|
93
99
|
yield
|
94
100
|
dt = time.time() - stime
|
@@ -103,26 +109,29 @@ class Profiler:
|
|
103
109
|
cpu_mem_use=cpu_mem_use,
|
104
110
|
gpu_mem_use=gpu_mem_use,
|
105
111
|
)
|
106
|
-
|
112
|
+
if self._torch_cuda_available:
|
113
|
+
torch.cuda.synchronize()
|
107
114
|
|
108
115
|
def log_stats(self, name: str):
|
109
116
|
stats = self.stats[name]
|
117
|
+
gpu_use_str = f"{stats['gpu_mem_use'] / (1024**2):0.3f} MB" if stats['gpu_mem_use'] is not None else 'N/A'
|
110
118
|
self.log(
|
111
119
|
f"{name}: {stats['fps']:0.3f} steps/s, {stats['psps']:0.3f} parallel steps/s, {stats['total_steps']} steps in {stats['dt']:0.3f}s"
|
112
120
|
)
|
113
121
|
self.log(
|
114
|
-
f"{' ' * 4}CPU mem: {stats['cpu_mem_use'] / (1024**2):0.3f} MB, GPU mem: {
|
122
|
+
f"{' ' * 4}CPU mem: {stats['cpu_mem_use'] / (1024**2):0.3f} MB, GPU mem: {gpu_use_str}"
|
115
123
|
)
|
116
124
|
|
117
125
|
def get_current_process_gpu_memory(self):
|
118
126
|
# Get all processes running on the GPU
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
127
|
+
if self._gpu_handle is not None:
|
128
|
+
processes = pynvml.nvmlDeviceGetComputeRunningProcesses(self._gpu_handle)
|
129
|
+
# Iterate through the processes to find the current process
|
130
|
+
for process in processes:
|
131
|
+
if process.pid == self.current_pid:
|
132
|
+
memory_usage = process.usedGpuMemory
|
133
|
+
return memory_usage
|
134
|
+
return None
|
126
135
|
def images_to_video(
|
127
136
|
images: List[np.ndarray],
|
128
137
|
output_dir: str,
|
{mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/RECORD
RENAMED
@@ -524,10 +524,10 @@ mani_skill/examples/demo_vis_pcd.py,sha256=QTerAyva4glh3y2fBDX_ZPmkMd114gYztQnL3
|
|
524
524
|
mani_skill/examples/demo_vis_segmentation.py,sha256=HESY-_XjQbofBZQbUl_fuAupQpr3H4ZerPzwGBBR12I,4281
|
525
525
|
mani_skill/examples/demo_vis_textures.py,sha256=m1hcOFQyMXu_C8ncnVHdhEksKBs-0e6Hb3UJvkPHG-4,3437
|
526
526
|
mani_skill/examples/benchmarking/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
527
|
-
mani_skill/examples/benchmarking/gpu_sim.py,sha256=
|
527
|
+
mani_skill/examples/benchmarking/gpu_sim.py,sha256=_Dm7IbjQgWtvq-T3XxJ0-aeFMDAB8QWgcqTA24OsdIQ,9935
|
528
528
|
mani_skill/examples/benchmarking/isaac_lab_gpu_sim.py,sha256=tATuRyJi37xHzCzbs-B3e0PS-l9oYj9FcLJC9F9Dtec,5581
|
529
529
|
mani_skill/examples/benchmarking/plot_results.py,sha256=jnfFOTar_VE6VnBJr5rQa715Uhv7AyzQMcRjX283BE4,12454
|
530
|
-
mani_skill/examples/benchmarking/profiling.py,sha256=
|
530
|
+
mani_skill/examples/benchmarking/profiling.py,sha256=ROtHXNrqHAlJkqc-30wynrQ3GxvYjuIIDJ_ozbClcQA,8656
|
531
531
|
mani_skill/examples/benchmarking/envs/__init__.py,sha256=lW_XjPqNAGLRaFbssHiOnSBboTTJO_--0GVduOh18Q8,101
|
532
532
|
mani_skill/examples/benchmarking/envs/isaaclab/__init__.py,sha256=ncUw7bBTKE1zi6c4lHor_S7X8E4iaxMIjlI3YPpGgcw,867
|
533
533
|
mani_skill/examples/benchmarking/envs/isaaclab/cartpole_state.py,sha256=0R72HnNVK45Qi6wQo_BtHfMIqkoSjo08jEdkLMyO05s,5292
|
@@ -687,8 +687,8 @@ mani_skill/vector/wrappers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
687
687
|
mani_skill/vector/wrappers/gymnasium.py,sha256=v1MDPIrVACBKCulrpdXBK2jDZQI7LKYFZgGgaCC5avY,7408
|
688
688
|
mani_skill/vector/wrappers/sb3.py,sha256=SlXdiEPqcNHYMhJCzA29kBU6zK7DKTe1nc0L6Z3QQtY,4722
|
689
689
|
mani_skill/viewer/__init__.py,sha256=0l9mfA-65WLaiAg4bcJqzwfKH5Eom5UtkxU68NyR2Jc,1609
|
690
|
-
mani_skill_nightly-2025.3.
|
691
|
-
mani_skill_nightly-2025.3.
|
692
|
-
mani_skill_nightly-2025.3.
|
693
|
-
mani_skill_nightly-2025.3.
|
694
|
-
mani_skill_nightly-2025.3.
|
690
|
+
mani_skill_nightly-2025.3.20.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
691
|
+
mani_skill_nightly-2025.3.20.0.dist-info/METADATA,sha256=UPlTWgrPgcws4NAEL0lAIJgGIeMwu9XiRuMePVJD41I,9289
|
692
|
+
mani_skill_nightly-2025.3.20.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
693
|
+
mani_skill_nightly-2025.3.20.0.dist-info/top_level.txt,sha256=bkBgOVl_MZMoQx2aRFsSFEYlZLxjWlip5vtJ39FB3jA,11
|
694
|
+
mani_skill_nightly-2025.3.20.0.dist-info/RECORD,,
|
{mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/LICENSE
RENAMED
File without changes
|
{mani_skill_nightly-2025.3.19.2322.dist-info → mani_skill_nightly-2025.3.20.0.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|