Skip to content

Official Codebase of 3DCodeVerse

Python

render_scene: the scene driver's GPU switch comes from Settings alone — no raw os.environ check beside it

gaoypeng3dd51c983017
diff --git a/harness/codeverse3d/spatial/render_scene.py b/harness/codeverse3d/spatial/render_scene.py
index 3277aeff..288b9011 100644
--- a/harness/codeverse3d/spatial/render_scene.py
+++ b/harness/codeverse3d/spatial/render_scene.py
@@ -16,7 +16,6 @@ from __future__ import annotations
import json
import logging
-import os
from collections.abc import Sequence
from pathlib import Path
from typing import Any
@@ -74,7 +73,7 @@ def run_scene_script(script: str, args: Sequence[str], *, timeout_s: float, cwd:
raise SceneRenderError(f"missing node driver {path}")
env_extra: dict[str, str] = {}
gpu = get_settings().render.gpu
- if gpu and "C3D_RENDER_GPU" not in os.environ:
+ if gpu: # Settings already folds the flat C3D_RENDER_GPU in; the driver reads only that spelling
env_extra["C3D_RENDER_GPU"] = gpu
argv = [str(a) for a in args]