From 5a0c69efe2051a37bc18d2ec6ac966aba15f4562 Mon Sep 17 00:00:00 2001 From: opg Date: Tue, 25 Feb 2025 20:27:57 -0500 Subject: [PATCH 1/2] Install numba-cuda 0.4.0 and configure numba for JIT link This is to fix https://github.com/googlecolab/colabtools/issues/5081#issuecomment-2629611179 --- GPU_puzzlers.ipynb | 3 ++- lib.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GPU_puzzlers.ipynb b/GPU_puzzlers.ipynb index 034ee2c..ba17cce 100644 --- a/GPU_puzzlers.ipynb +++ b/GPU_puzzlers.ipynb @@ -128,7 +128,8 @@ ], "source": [ "!pip install -qqq git+https://github.com/chalk-diagrams/planar git+https://github.com/danoneata/chalk@srush-patch-1\n", - "!wget -q https://github.com/srush/GPU-Puzzles/raw/main/robot.png https://github.com/srush/GPU-Puzzles/raw/main/lib.py" + "!wget -q https://github.com/srush/GPU-Puzzles/raw/main/robot.png https://github.com/srush/GPU-Puzzles/raw/main/lib.py", + "!pip install -qqq numba-cuda==0.4.0" ] }, { diff --git a/lib.py b/lib.py index ce09e11..90e8da0 100644 --- a/lib.py +++ b/lib.py @@ -6,10 +6,13 @@ from dataclasses import dataclass from typing import List, Any from collections import Counter -from numba import cuda +from numba import cuda, config import numba import random +config.CUDA_ENABLE_PYNVJITLINK = 1 +config.CUDA_LOW_OCCUPANCY_WARNINGS = 0 + @dataclass class ScalarHistory: last_fn: str From 69bba706e8c89d1ca734782081df157b3deabb8c Mon Sep 17 00:00:00 2001 From: opg Date: Tue, 25 Feb 2025 20:45:30 -0500 Subject: [PATCH 2/2] Re-order commands and add missing newline --- GPU_puzzlers.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GPU_puzzlers.ipynb b/GPU_puzzlers.ipynb index ba17cce..b4a98c4 100644 --- a/GPU_puzzlers.ipynb +++ b/GPU_puzzlers.ipynb @@ -127,9 +127,9 @@ } ], "source": [ + "!pip install -qqq numba-cuda==0.4.0\n", "!pip install -qqq git+https://github.com/chalk-diagrams/planar git+https://github.com/danoneata/chalk@srush-patch-1\n", - "!wget -q https://github.com/srush/GPU-Puzzles/raw/main/robot.png https://github.com/srush/GPU-Puzzles/raw/main/lib.py", - "!pip install -qqq numba-cuda==0.4.0" + "!wget -q https://github.com/srush/GPU-Puzzles/raw/main/robot.png https://github.com/srush/GPU-Puzzles/raw/main/lib.py" ] }, { @@ -6544,4 +6544,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +}