#!/bin/bash #SBATCH --job-name=dppo_mujoco_final #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_final_%j.out #SBATCH --error=logs/dppo_mujoco_final_%j.err # Load Intel OneAPI for Python support but use GCC for compilation module load devel/cuda/12.4 cd $SLURM_SUBMIT_DIR source .venv/bin/activate # Force GCC compilation export CC=/usr/bin/gcc export CXX=/usr/bin/g++ export CFLAGS="-std=c99 -O2 -fPIC" export CXXFLAGS="-std=c++11 -O2 -fPIC" # Clean mujoco-py completely 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 echo "Installing exact compatible versions..." pip uninstall mujoco-py cython -y # Install compatible Cython first and pin it pip install 'Cython==0.29.37' # Install mujoco-py without allowing dependency upgrades pip install 'mujoco-py<2.2,>=2.1' --no-deps pip install 'glfw>=1.4.0' 'numpy>=1.11,<2.0' 'imageio>=2.1.2' 'cffi>=1.10' 'fasteners~=0.15' # 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 pinned compatible versions..." python -c "import mujoco_py; print('SUCCESS: mujoco_py compiled successfully!')"