Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ggml/src/ggml-cuda/ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4124,9 +4124,13 @@ static void ggml_backend_cuda_graph_optimize(ggml_backend_t backend, ggml_cgraph
GGML_UNUSED(cgraph);
#endif

static bool enable_graph_optimization = [] {
const char * env = getenv("GGML_CUDA_GRAPH_OPT");
return env != nullptr && atoi(env) == 1;
static bool enable_graph_optimization = [cuda_ctx] {
const char * env = getenv("GGML_CUDA_GRAPH_OPT");
if (env != nullptr) {
return atoi(env) == 1;
}
const int cc = ggml_cuda_info().devices[cuda_ctx->device].cc;
return GGML_CUDA_CC_IS_RDNA3_5(cc);
}();

if (!enable_graph_optimization) {
Expand Down
Loading