#!/bin/bash #SBATCH --job-name=dppo_mujoco_clean #SBATCH --account=hk-project-p0022232 #SBATCH --partition=dev_accelerated #SBATCH --gres=gpu:1 #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=8 #SBATCH --time=00:30:00 #SBATCH --mem=24G #SBATCH --output=logs/dppo_mujoco_clean_%j.out #SBATCH --error=logs/dppo_mujoco_clean_%j.err # Load only CUDA, avoid Intel modules completely module purge module load devel/cuda/12.4 # Clean environment - remove any Intel compiler variables unset CFLAGS unset CXXFLAGS unset LDFLAGS unset CC unset CXX # Force pure GCC environment export CC=/usr/bin/gcc export CXX=/usr/bin/g++ export CFLAGS="-std=c99" export CXXFLAGS="-std=c++11" cd $SLURM_SUBMIT_DIR source .venv/bin/activate # Complete mujoco-py cleanup echo "Removing all mujoco-py build artifacts..." rm -rf .venv/lib/python3.10/site-packages/mujoco_py/generated/ rm -rf .venv/lib/python3.10/site-packages/mujoco_py/.eggs/ rm -rf .venv/lib/python3.10/site-packages/mujoco_py/build/ find .venv/lib/python3.10/site-packages/mujoco_py/ -name "*.so" -delete find .venv/lib/python3.10/site-packages/mujoco_py/ -name "*.pyc" -delete # Fresh mujoco-py install echo "Reinstalling mujoco-py with clean GCC environment..." pip uninstall mujoco-py -y pip install 'mujoco-py<2.2,>=2.1' # MuJoCo environment export MUJOCO_PY_MUJOCO_PATH=/home/hk-project-robolear/ys1087/.mujoco/mujoco210 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hk-project-robolear/ys1087/.mujoco/mujoco210/bin:/usr/lib/nvidia export MUJOCO_GL=egl echo "Testing mujoco-py import with clean environment..." python -c "import mujoco_py; print('SUCCESS: mujoco_py works with clean GCC compilation!')"