32 Commits

Author SHA1 Message Date
Cosmin Ștefan Ciocan 3f8b89cb58 Merge branch 'master' into feature/profiler-tool-choice 2024-02-16 23:57:06 +01:00
Cosmin Ștefan Ciocan 4d805bb98e Mention Nsight Systems in README.md 2024-02-16 22:50:58 +00:00
Cosmin Ștefan Ciocan c3b8524be6 Fix cuda typo 2024-02-12 19:49:08 +01:00
Cosmin Ștefan Ciocan 0908891a47 Add documentation for using Nsight Systems instead of the default Nsight Compute profiling tool 2024-02-02 23:08:02 +00:00
Cosmin Ștefan Ciocan bac447ef67 Install dev dependencies in editable mode 2024-02-02 23:05:50 +00:00
Cosmin Ștefan Ciocan ba775f7ce1 Search for profiling tools executable paths when they are required 2024-02-02 14:40:29 +00:00
Cosmin Ștefan Ciocan 26fab4d31e Replace experimental-string-processing black formatter config with enable-unstable-feature as it was removed in version 24.1.0 2024-02-02 13:31:18 +00:00
Cosmin Ștefan Ciocan 5a880c93bd Add isort config to help it find local modules so they are not considered 3rd party libraries 2024-02-02 13:26:40 +00:00
Cosmin Ștefan Ciocan 2c108442f6 Add tests for choosing the profiler 2024-02-01 14:55:17 +00:00
Cosmin Ștefan Ciocan 8d39ce01c3 Add option to choose between NSYS and NCU profilers 2024-02-01 14:46:45 +00:00
Cosmin Ștefan Ciocan ee9aa3dba3 Change devcontainer base image back to ubuntu:22.04 to match the environment from the test runner 2024-01-27 14:45:16 +00:00
Cosmin Ștefan Ciocan 27b045b782 Update way to set environment variable PATH in github action 2024-01-27 14:35:06 +00:00
Cosmin Ștefan Ciocan 2614c92b20 Add cuda bin to path variable in .bashrc 2024-01-27 13:49:00 +00:00
Cosmin Ștefan Ciocan 863cdcfa17 Add CUDA bin to PATH in test and coverage runners 2024-01-27 13:42:22 +00:00
Cosmin Ștefan Ciocan 28637d5c64 Install opencv in test runner and update code coverage install 2024-01-27 13:35:16 +00:00
Cosmin Ștefan Ciocan aaaa2605e1 Install latest CUDA toolkit on the test runner to pass the OpenCV compilation test 2024-01-27 13:26:33 +00:00
Cosmin Ștefan Ciocan 9663c74598 Change version from 1.0.3 to 1.1.0 due to adding features in a backward-compatible manner 2024-01-27 02:04:34 +00:00
Cosmin Ștefan Ciocan a3f4f31962 Update contributing instructions 2024-01-27 01:57:09 +00:00
Cosmin Ștefan Ciocan 33801a3491 Update pylint exceptions 2024-01-27 01:42:17 +00:00
Cosmin Ștefan Ciocan b3c015ae74 Add function that modifies the default profiler/compiler arguments to allow reusing them in multiple magic command calls 2024-01-27 01:40:47 +00:00
Cosmin Ștefan Ciocan e9f131a678 Add autodocstring vscode extension to devcontainer 2024-01-27 00:41:39 +00:00
Cosmin Ștefan Ciocan bc91620971 Add new page to documentation that contains a new notebook that explains compiling with external libraries 2024-01-26 16:22:29 +00:00
Cosmin Ștefan Ciocan c1fbc06604 Add test to compile with opencv 2024-01-26 11:30:32 +00:00
Cosmin Ștefan Ciocan b49062e9e2 Mock the nsight compute tool with a bash script 2024-01-26 11:25:58 +00:00
Cosmin Ștefan Ciocan 36fc282eed Change devcontainer base image to have the latest CUDA toolkit 2024-01-26 11:11:23 +00:00
Cosmin Ștefan Ciocan 639624be79 Add IPython to docs requirements to allow the __version__ import for readthedocs env 2024-01-24 00:17:35 +00:00
Cosmin Ștefan Ciocan 6236fe2b1e Improve tests coverage by testing for bad arguments and the error output during a failed compilation 2024-01-23 23:44:36 +00:00
Cosmin Ștefan Ciocan 65eca38a67 Document new --compiler-args argument 2024-01-23 23:01:38 +00:00
Cosmin Ștefan Ciocan 405c16efb3 Update documentation config to automatically import the current version of the package 2024-01-23 22:58:56 +00:00
Cosmin Ștefan Ciocan 595e450eb9 Add make and the english language pack to devcontainer to be able to build the documentation 2024-01-23 22:57:59 +00:00
Cosmin Ștefan Ciocan 50bc8ff4a6 Add test for nvcc options that changes c++ dialect from c++17 to c++14 2024-01-23 22:55:53 +00:00
Cosmin Ștefan Ciocan 881c67f5f1 Add option to give nvcc extra arguments 2024-01-23 22:53:47 +00:00
5 changed files with 4 additions and 79 deletions
+3
View File
@@ -28,6 +28,9 @@ pip-delete-this-directory.txt
nosetests.xml nosetests.xml
coverage.xml coverage.xml
# Virtual Environment
*env*
# Misc # Misc
.pytest_cache/ .pytest_cache/
.DS_Store .DS_Store
+1 -1
View File
@@ -5,4 +5,4 @@ nvcc4jupyter: CUDA C++ plugin for Jupyter Notebook
from .parsers import Profiler, set_defaults # noqa: F401 from .parsers import Profiler, set_defaults # noqa: F401
from .plugin import NVCCPlugin, load_ipython_extension # noqa: F401 from .plugin import NVCCPlugin, load_ipython_extension # noqa: F401
__version__ = "1.2.1" __version__ = "1.1.0"
-2
View File
@@ -23,7 +23,6 @@ from .parsers import (
get_parser_cuda_group_save, get_parser_cuda_group_save,
) )
from .path_utils import CUDA_SEARCH_PATHS, find_executable from .path_utils import CUDA_SEARCH_PATHS, find_executable
from .setup_env import setup_environment
DEFAULT_EXEC_FNAME = "cuda_exec.out" DEFAULT_EXEC_FNAME = "cuda_exec.out"
SHARED_GROUP_NAME = "shared" SHARED_GROUP_NAME = "shared"
@@ -365,6 +364,5 @@ def load_ipython_extension(shell: InteractiveShell):
""" """
Method used by IPython to load the extension. Method used by IPython to load the extension.
""" """
setup_environment()
nvcc_plugin = NVCCPlugin(shell) nvcc_plugin = NVCCPlugin(shell)
shell.register_magics(nvcc_plugin) shell.register_magics(nvcc_plugin)
-72
View File
@@ -1,72 +0,0 @@
"""
Setup steps for platforms such as Kaggle, Colab, etc. to allow our extension
to work on them immediately after loading it.
"""
# pylint: disable=missing-function-docstring
import os
import traceback
from subprocess import DEVNULL, STDOUT, check_call
from typing import Optional
PATH_PRIORITY_DIR = "/usr/bin/priority"
KAGGLE_GCC_8_PATH = "/usr/bin/gcc-8"
def print_platform(platform: str) -> None:
print(f'Detected platform "{platform}". Running its setup...')
def kaggle_setup() -> None:
print("Updating the package lists...")
check_call(["/usr/bin/apt-get", "update"], stdout=DEVNULL, stderr=STDOUT)
print("Installing nvidia-cuda-toolkit, this may take a few minutes...")
check_call(
["/usr/bin/apt-get", "install", "-y", "nvidia-cuda-toolkit"],
stdout=DEVNULL,
stderr=STDOUT,
)
os.makedirs(PATH_PRIORITY_DIR, exist_ok=True)
gcc_symlink_path = os.path.join(PATH_PRIORITY_DIR, "gcc")
if not os.path.exists(gcc_symlink_path):
os.symlink(KAGGLE_GCC_8_PATH, gcc_symlink_path)
if PATH_PRIORITY_DIR not in os.environ["PATH"].split(":"):
os.environ["PATH"] = f"{PATH_PRIORITY_DIR}:" + os.environ["PATH"]
def colab_setup() -> None:
pass
def setup_environment() -> None:
"""
Detect the platform the extension was loaded on and run the necessary
steps (install dependencies, add executables to PATH, etc.) for the
extension to work.
"""
if "NVCC4JUPYTER_NO_SETUP" in os.environ:
return
platform: Optional[str] = None
try:
if "KAGGLE_URL_BASE" in os.environ:
platform = "Kaggle"
print_platform(platform)
kaggle_setup()
elif "COLAB_RELEASE_TAG" in os.environ:
platform = "Colab"
print_platform(platform)
colab_setup()
except Exception: # pylint: disable=broad-exception-caught
print(
f'Setup failed for detected platform "{platform}". Set the'
' "NVCC4JUPYTER_NO_SETUP" environment variable to disable running'
" the setup on load. Please report the following error to"
" https://github.com/andreinechaev/nvcc4jupyter/issues:"
f" following error message:\n{traceback.format_exc()}"
)
-4
View File
@@ -88,10 +88,6 @@ enable-unstable-feature = ["string_processing"]
[tool.coverage.run] [tool.coverage.run]
branch = true branch = true
omit = [
# cannot test installing dependencies on platforms such as kaggle
"nvcc4jupyter/setup_env.py",
]
[tool.pyright] [tool.pyright]
include = ["src"] include = ["src"]