dppo/slurm/dev_tests/test_mujoco_isolated.sh
ys1087@partner.kit.edu 826b55a2d2 Integrate HoReKa Intel compiler fix for mujoco-py
- Add HoReKa-specific MuJoCo compilation fix to install script
- Pin compatible Cython version (0.29.37)
- Create fix_mujoco_compilation.py helper script
- Document Intel compiler override in README
- Update test script to use integrated fix
- Addresses Intel OneAPI compiler flag incompatibility with GCC
2025-08-27 16:09:13 +02:00

57 lines
1.9 KiB
Bash

#!/bin/bash
#SBATCH --job-name=dppo_mujoco_isolated
#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_isolated_%j.out
#SBATCH --error=logs/dppo_mujoco_isolated_%j.err
# Keep Intel OneAPI for Python but isolate compilation
module load devel/cuda/12.4
module load compiler/intel/2023.2.1
cd $SLURM_SUBMIT_DIR
source .venv/bin/activate
# Override all compiler settings to force pure GCC
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
# Clear all Intel compiler flags
unset CFLAGS
unset CXXFLAGS
unset FFLAGS
unset LDFLAGS
# Set clean GCC-compatible flags
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
# Force clean distutils cache
rm -rf ~/.cache/pip/
python -c "import distutils.util; import shutil; shutil.rmtree(distutils.util.get_platform(), ignore_errors=True)" 2>/dev/null || true
echo "Reinstalling mujoco-py with isolated GCC compilation..."
pip uninstall mujoco-py -y
pip install 'mujoco-py<2.2,>=2.1' --no-cache-dir --force-reinstall
# 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 isolated GCC compilation..."
python -c "import mujoco_py; print('SUCCESS: mujoco_py compiled with isolated GCC!')"