Skip to content

Commit 46c9d20

Browse files
committed
latest
2 parents e74e33b + 378cff7 commit 46c9d20

127 files changed

Lines changed: 2892 additions & 3210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,8 @@ pufferlib/ocean/impulse_wars/*-release/
165165
pufferlib/ocean/impulse_wars/debug-*/
166166
pufferlib/ocean/impulse_wars/release-*/
167167
pufferlib/ocean/impulse_wars/benchmark/
168+
169+
# Data
170+
resources/drive/data/*
171+
resources/drive/binaries/*
172+

build.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ fi
108108

109109
# Constellation needs cJSON
110110
[ "$ENV" = "constellation" ] && EXTRA_SRC="vendor/cJSON.c" && INCLUDES+=(-I./vendor) && OUTPUT_NAME="seethestars"
111+
[ "$ENV" = "trailer" ] && INCLUDES+=(-I./vendor) && OUTPUT_NAME="trailer/trailer"
111112

112113
# ============================================================================
113114
# Standalone builds: --local, --fast, --web
@@ -154,7 +155,9 @@ fi
154155
# Default: build _C.so with env statically linked
155156
# ============================================================================
156157

157-
CUDA_HOME=${CUDA_HOME:-${CUDA_PATH:-/usr/local/cuda}}
158+
CUDA_HOME=${CUDA_HOME:-${CUDA_PATH:-$(dirname $(dirname $(which nvcc)))}}
159+
CUDNN_INCLUDE=$(python -c "import nvidia.cudnn; import os; print(os.path.join(nvidia.cudnn.__path__[0], 'include'))" 2>/dev/null || echo "")
160+
CUDNN_LIB=$(python -c "import nvidia.cudnn; import os; print(os.path.join(nvidia.cudnn.__path__[0], 'lib'))" 2>/dev/null || echo "")
158161
NVCC="$CUDA_HOME/bin/nvcc"
159162

160163
PYTHON_INCLUDE=$(python -c "import sysconfig; print(sysconfig.get_path('include'))")
@@ -179,23 +182,23 @@ clang -c $CLANG_OPT \
179182
"$BINDING_SRC" -o "$STATIC_OBJ"
180183
ar rcs "$STATIC_LIB" "$STATIC_OBJ"
181184

182-
OBS_TENSOR_T=$(strings "$STATIC_OBJ" | grep 'Tensor$' | head -1)
183-
[ -z "$OBS_TENSOR_T" ] && echo "Error: Could not find OBS_TENSOR_T" && exit 1
185+
OBS_TENSOR_T=$(awk '/^#define OBS_TENSOR_T/{print $3}' "$BINDING_SRC")
186+
[ -z "$OBS_TENSOR_T" ] && echo "Error: Could not find OBS_TENSOR_T in $BINDING_SRC" && exit 1
184187
echo "OBS_TENSOR_T=$OBS_TENSOR_T"
185188

186189
# Step 2: Profile binary or Python bindings
187190
if [ "$MODE" = "profile" ]; then
188191
ARCH=${NVCC_ARCH:-sm_89}
189192
echo "=== Building profile binary (arch=$ARCH) ==="
190193
$NVCC $NVCC_OPT -arch=$ARCH -std=c++17 \
191-
-I. -Isrc -I$SRC_DIR \
192-
-I$CUDA_HOME/include -I$RAYLIB_NAME/include \
194+
-I. -Isrc -I$SRC_DIR -I./vendor \
195+
-I$CUDA_HOME/include ${CUDNN_INCLUDE:+-I$CUDNN_INCLUDE} -I$RAYLIB_NAME/include \
193196
-DOBS_TENSOR_T=$OBS_TENSOR_T \
194197
-DENV_NAME=$ENV \
195198
-Xcompiler=-DPLATFORM_DESKTOP \
196199
$PRECISION \
197200
-Xcompiler=-fopenmp \
198-
tests/profile_kernels.cu ini.c \
201+
tests/profile_kernels.cu vendor/ini.c \
199202
"$STATIC_LIB" "$RAYLIB_A" \
200203
-lnccl -lnvidia-ml -lcublas -lcurand -lcudnn \
201204
-lGL -lm -lpthread -lomp5 \
@@ -239,7 +242,7 @@ $NVCC -c -Xcompiler -fPIC \
239242
-std=c++17 \
240243
-I. -Isrc \
241244
-I$PYTHON_INCLUDE -I$PYBIND_INCLUDE -I$NUMPY_INCLUDE \
242-
-I$CUDA_HOME/include -I$RAYLIB_NAME/include \
245+
-I$CUDA_HOME/include ${CUDNN_INCLUDE:+-I$CUDNN_INCLUDE} -I$RAYLIB_NAME/include \
243246
-Xcompiler=-fopenmp \
244247
-DOBS_TENSOR_T=$OBS_TENSOR_T \
245248
$PRECISION $NVCC_OPT \
@@ -250,7 +253,7 @@ echo "=== Linking $OUTPUT ==="
250253
LINK_CMD=(
251254
g++ -shared -fPIC -fopenmp
252255
src/bindings.o "$STATIC_LIB" "$RAYLIB_A"
253-
-L$CUDA_HOME/lib64
256+
-L$CUDA_HOME/lib64 ${CUDNN_LIB:+-L$CUDNN_LIB}
254257
-lcudart -lnccl -lnvidia-ml -lcublas -lcusolver -lcurand -lcudnn
255258
-lomp5
256259
$LINK_OPT

config/atari.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.
File renamed without changes.

config/box2d.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)