SemSorter commited on
Commit
c5a8f36
·
1 Parent(s): b97f1d0

Optimize MuJoCo render resolution and worker count to fix Render memory limits

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -1
  2. SemSorter/simulation/controller.py +3 -3
Dockerfile CHANGED
@@ -36,5 +36,10 @@ ENV PYOPENGL_PLATFORM=egl
36
  # ── Expose port ───────────────────────────────────────────────────────────────
37
  EXPOSE 8000
38
 
 
 
 
 
 
39
  # ── Start server ──────────────────────────────────────────────────────────────
40
- CMD ["uvicorn", "SemSorter.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
 
36
  # ── Expose port ───────────────────────────────────────────────────────────────
37
  EXPOSE 8000
38
 
39
+ # ── Limit Threads to save memory on Render Free Tier ──────────────────────────
40
+ ENV OPENBLAS_NUM_THREADS=1
41
+ ENV OMP_NUM_THREADS=1
42
+ ENV MKL_NUM_THREADS=1
43
+
44
  # ── Start server ──────────────────────────────────────────────────────────────
45
+ CMD ["uvicorn", "SemSorter.server.app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
SemSorter/simulation/controller.py CHANGED
@@ -166,9 +166,9 @@ class SemSorterSimulation:
166
  # Modify the model name
167
  spec.modelname = "semsorter"
168
 
169
- # Set offscreen framebuffer size for rendering
170
- spec.visual.global_.offwidth = 1920
171
- spec.visual.global_.offheight = 1080
172
 
173
  # ─── Add additional lights ───────────────────────────────────────
174
  world = spec.worldbody
 
166
  # Modify the model name
167
  spec.modelname = "semsorter"
168
 
169
+ # Set offscreen framebuffer size for rendering (lowered to save RAM on Render Free Tier)
170
+ spec.visual.global_.offwidth = 960
171
+ spec.visual.global_.offheight = 540
172
 
173
  # ─── Add additional lights ───────────────────────────────────────
174
  world = spec.worldbody