Skip to content

Commit

Permalink
switch to JLLs (#21)
Browse files Browse the repository at this point in the history
* switch to JLLs
* use nvidia apt
  • Loading branch information
simonbyrne authored Nov 22, 2022
1 parent 54c215b commit 2f44552
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,26 @@ jobs:
- "1"
- "nightly"

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 40
steps:
- name: Install CUDA toolkit
uses: Jimver/cuda-toolkit@v0.2.8
# based on https://github.com/pytorch/TensorRT/blob/10b9ecd488c10a79a19466df8509e7059ce27f02/.github/workflows/docgen.yml#L48-L64
- name: Install Nsight Systems
run: |
sudo apt-get update
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get install -y nsight-systems-2022.4.2
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia_version }}

- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ version = "0.2.0"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
JuliaNVTXCallbacks_jll = "9c1d0b0a-7046-5b2e-a33f-ea22f176ac7e"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
NVTX_jll = "e98f9f5b-d649-5603-91fd-7774390e6439"

[compat]
Colors = "0.12"
Expand Down
6 changes: 6 additions & 0 deletions deps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Julia runtime NVTX callbacks

This contains a small C library containing functions for instrumenting the Julia runtime with NVTX, which can be used as callbacks into the Julia runtime.

These are built as via BinaryBuilder here:
https://github.com/JuliaPackaging/Yggdrasil/tree/master/J/JuliaNVTXCallbacks
9 changes: 0 additions & 9 deletions deps/build.jl

This file was deleted.

2 changes: 1 addition & 1 deletion src/NVTX.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module NVTX

import Colors, Libdl
using NVTX_jll, JuliaNVTXCallbacks_jll

const libnvToolsExt = "libnvToolsExt"
const NSYS_ACTIVE = Ref{Bool}(false)

"""
Expand Down
2 changes: 0 additions & 2 deletions src/julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ function name_threads_julia()
end

# domain used for instrumenting Julia runtime
const libjulia_nvtx_callbacks = joinpath(@__DIR__, "..", "deps", "libjulia_nvtx_callbacks.$(Libdl.dlext)")

const JULIA_DOMAIN = Domain("Julia")
const GC_MESSAGE = StringHandle(JULIA_DOMAIN, "GC")
const GC_ALLOC_MESSAGE = StringHandle(JULIA_DOMAIN, "alloc")
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ else
dirname = mktempdir()
end

run(`nsys profile --output=$(joinpath(dirname, "basic")) --export=json,sqlite --trace=nvtx $(Base.julia_cmd()) --project=$(Base.active_project()) --threads=3 basic.jl`)
run(`nsys stats --report nvtxsum $(joinpath(dirname, "basic.sqlite"))`)
nsys = get(ENV, "JULIA_NSYS", "nsys")

run(`$nsys profile --output=$(joinpath(dirname, "basic")) --export=json,sqlite --trace=nvtx $(Base.julia_cmd()) --project=$(Base.active_project()) --threads=3 basic.jl`)
run(`$nsys stats --report nvtxsum $(joinpath(dirname, "basic.sqlite"))`)

0 comments on commit 2f44552

Please sign in to comment.