diff --git a/Project.toml b/Project.toml index b1be85d24c..68c672b82c 100644 --- a/Project.toml +++ b/Project.toml @@ -52,8 +52,8 @@ Adapt = "4" BFloat16s = "0.2, 0.3, 0.4, 0.5" CEnum = "0.2, 0.3, 0.4, 0.5" CUDA_Driver_jll = "0.8" -CUDA_Runtime_Discovery = "0.2" -CUDA_Runtime_jll = "0.12" +CUDA_Runtime_Discovery = "0.2, 0.3" +CUDA_Runtime_jll = "0.12, 0.13" ChainRulesCore = "1" Crayons = "4" DataFrames = "1" diff --git a/README.md b/README.md index 01b24b4765..28399c588c 100644 --- a/README.md +++ b/README.md @@ -34,16 +34,18 @@ kernels in Julia, and wrappers for various CUDA libraries. The latest development version of CUDA.jl requires **Julia 1.8** or higher. If you are using an older version of Julia, you need to use a previous version of CUDA.jl. This will happen -automatically when you install the package using Julia's package manager. - -Note that CUDA.jl may not work with a custom build of Julia; it is recommended that you -install Julia using the [official binaries](https://julialang.org/downloads/) or -[juliaup](https://github.com/JuliaLang/juliaup). - -CUDA.jl currently also requires a CUDA-capable GPU with **compute capability 3.5** (Kepler) -or higher, and an accompanying NVIDIA driver with support for **CUDA 11.0** or newer. These -requirements are not enforced by the Julia package manager when installing CUDA.jl. -Depending on your system and GPU, you may need to install an older version of the package: +automatically when you install the package using Julia's package manager. + +Note that CUDA.jl may not work with a custom build of Julia; it is recommended that you +install Julia using the [official binaries](https://julialang.org/downloads/) or +[juliaup](https://github.com/JuliaLang/juliaup). + +CUDA.jl also requires a CUDA-capable GPU with **compute capability 3.5** (Kepler) or +higher, and an accompanying **NVIDIA driver for CUDA 11.0** or newer. A compatible CUDA +toolkit will be downloaded automatically, but in case you want to use your own, CUDA.jl only +supports **CUDA toolkit 11.4+** or newer. These requirements are not enforced by the Julia +package manager when installing CUDA.jl. Depending on your system and GPU, you may need to +install an older version of the package: * CUDA.jl v4.4 is the last version with support for CUDA 11.0-11.3 (deprecated in v5.0) * CUDA.jl v4.0 is the last version to work with CUDA 10.2 (removed in v4.1) diff --git a/lib/cudnn/Project.toml b/lib/cudnn/Project.toml index a596fde750..01085e72c0 100644 --- a/lib/cudnn/Project.toml +++ b/lib/cudnn/Project.toml @@ -12,6 +12,6 @@ CUDNN_jll = "62b44479-cb7b-5706-934f-f13b2eb2e645" [compat] CEnum = "0.2, 0.3, 0.4, 0.5" CUDA = "~5.4" -CUDA_Runtime_Discovery = "0.2" +CUDA_Runtime_Discovery = "0.2, 0.3" CUDNN_jll = "~9.0" julia = "1.8" diff --git a/lib/custatevec/Project.toml b/lib/custatevec/Project.toml index cecf4cbf09..59c74c88a3 100644 --- a/lib/custatevec/Project.toml +++ b/lib/custatevec/Project.toml @@ -12,6 +12,6 @@ cuQuantum_jll = "b75408ef-6fdf-5d74-b65a-7df000ad18e6" [compat] CEnum = "0.2, 0.3, 0.4, 0.5" CUDA = "~5.4" -CUDA_Runtime_Discovery = "0.2" +CUDA_Runtime_Discovery = "0.2, 0.3" cuQuantum_jll = "~24.03" julia = "1.8" diff --git a/lib/cutensor/Project.toml b/lib/cutensor/Project.toml index 63524dfd28..765d1e2a1d 100644 --- a/lib/cutensor/Project.toml +++ b/lib/cutensor/Project.toml @@ -14,7 +14,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" [compat] CEnum = "0.2, 0.3, 0.4, 0.5" CUDA = "~5.4" -CUDA_Runtime_Discovery = "0.2" +CUDA_Runtime_Discovery = "0.2, 0.3" CUTENSOR_jll = "~2.0" LinearAlgebra = "1" julia = "1.8" diff --git a/lib/cutensornet/Project.toml b/lib/cutensornet/Project.toml index ac738392af..5ef3cee32e 100644 --- a/lib/cutensornet/Project.toml +++ b/lib/cutensornet/Project.toml @@ -14,7 +14,7 @@ cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1" [compat] CEnum = "0.2, 0.3, 0.4, 0.5" CUDA = "~5.4" -CUDA_Runtime_Discovery = "0.2" +CUDA_Runtime_Discovery = "0.2, 0.3" cuQuantum_jll = "~24.3" cuTENSOR = "2" julia = "1.8" diff --git a/src/compatibility.jl b/src/compatibility.jl index 6cf077c525..8d651e375b 100644 --- a/src/compatibility.jl +++ b/src/compatibility.jl @@ -110,6 +110,8 @@ const cuda_ptx_db = Dict( v"8.0" => between(v"12.0", highest), v"8.1" => between(v"12.1", highest), v"8.2" => between(v"12.2", highest), + v"8.3" => between(v"12.3", highest), + v"8.4" => between(v"12.4", highest), ) function cuda_ptx_support(ver::VersionNumber) diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl index b4613e208b..96580e08f8 100644 --- a/src/compiler/compilation.jl +++ b/src/compiler/compilation.jl @@ -207,7 +207,7 @@ end # determine the compute capabilities to use. this should match the capability of the # current device, but if LLVM doesn't support it, we can target an older capability - # and pass a different `-arch` to `ptxa`. + # and pass a different `-arch` to `ptxas`. ptx_support = ptx_compat(cuda_ptx) requested_cap = something(cap, min(capability(dev), maximum(ptx_support.cap))) llvm_caps = filter(<=(requested_cap), llvm_support.cap) diff --git a/src/initialization.jl b/src/initialization.jl index 759dd40f54..2953542d60 100644 --- a/src/initialization.jl +++ b/src/initialization.jl @@ -185,13 +185,6 @@ function __init__() Ensure that you have not set the LD_LIBRARY_PATH environment variable, or that it does not contain paths to CUDA libraries.""" end end - - # warn about Tegra being incompatible with our artifacts - if is_tegra() - @warn """You are using a Tegra device, which is currently not supported by the CUDA.jl artifacts. - Please install the CUDA toolkit, and call `CUDA.set_runtime_version!(local_toolkit=true)`. - For more information, see JuliaGPU/CUDA.jl#1978.""" - end end _initialized[] = true diff --git a/src/utilities.jl b/src/utilities.jl index 9ffe856fb8..b3b31880f0 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -175,27 +175,3 @@ function versioninfo(io::IO=stdout) println(io, " $(i-1): $str (sm_$(cap.major)$(cap.minor), $(Base.format_bytes(mem.free)) / $(Base.format_bytes(mem.total)) available)") end end - -# this helper function encodes options for compute-sanitizer useful with Julia applications -function compute_sanitizer_cmd(tool::String="memcheck") - sanitizer = CUDA.compute_sanitizer() - cmd = `$sanitizer --tool $tool --launch-timeout=0 --target-processes=all --report-api-errors=no` - if runtime_version() >= v"12.3" && - attribute(device(), DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS) == 1 - cmd = `$cmd --hmm-support` - end - cmd -end - -""" - run_compute_sanitizer([julia_args=``]; [tool="memcheck", sanitizer_args=``]) - -Run a new Julia session under the CUDA compute-sanitizer tool `tool`. This is useful to -detect various GPU-related issues, like memory errors or race conditions. -""" -function run_compute_sanitizer(julia_args=``; tool::String="memcheck", sanitizer_args=``) - cmd = `$(Base.julia_cmd()) --project=$(Base.active_project())` - - println("Re-starting your active Julia session...") - run(`$(CUDA.compute_sanitizer_cmd(tool)) $sanitizer_args $cmd $julia_args`) -end diff --git a/test/Project.toml b/test/Project.toml index 04b15f52b8..9b6f71508d 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -17,6 +17,7 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" NVTX = "5da4648a-3479-48b8-97b9-01cb529c0a1f" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/test/runtests.jl b/test/runtests.jl index 0cf54368d9..d7bd19ffec 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -171,6 +171,23 @@ if first(gpus).compute_mode == CUDA.CU_COMPUTEMODE_EXCLUSIVE_PROCESS jobs = 1 end +# install compute sanitizer +if do_sanitize + # install CUDA_SDK_jll in a temporary environment + using Pkg + project = Base.active_project() + Pkg.activate(; temp=true) + Pkg.add("CUDA_SDK_jll") + using CUDA_SDK_jll + Pkg.activate(project) + + compute_sanitizer = joinpath(CUDA_SDK_jll.artifact_dir, "cuda/compute-sanitizer/compute-sanitizer") + if Sys.iswindows() + compute_sanitizer *= ".exe" + end + @info "Running under " * read(`$compute_sanitizer --version`, String) +end + # add workers const test_exeflags = Base.julia_cmd() filter!(test_exeflags.exec) do c @@ -183,7 +200,11 @@ push!(test_exeflags.exec, "--project=$(Base.active_project())") const test_exename = popfirst!(test_exeflags.exec) function addworker(X; kwargs...) exename = if do_sanitize - `$(CUDA.compute_sanitizer_cmd(sanitize_tool)) $test_exename` + ```$compute_sanitizer --tool $sanitize_tool + --launch-timeout=0 + --target-processes=all + --report-api-errors=no + $test_exename``` else test_exename end