ITensorGPU installation and usage

Hi All, I am trying to install and use ITensorGPU but without success.
I can install CUDA and cuTENSOR, and the test of the two packes is fine.
I can install ITensorGPU but for some reaons it cannot use cuTENSOR.

Below is the output of my CUDA.versioninfo

julia> CUDA.versioninfo()
CUDA runtime 11.8, artifact installation
CUDA driver 12.1
NVIDIA driver 530.30.2

Libraries:

  • CUBLAS: 11.11.3
  • CURAND: 10.3.0
  • CUFFT: 10.9.0
  • CUSOLVER: 11.4.1
  • CUSPARSE: 11.7.5
  • CUPTI: 18.0.0
  • NVML: 12.0.0+530.30.2

Toolchain:

  • Julia: 1.8.5
  • LLVM: 13.0.1
  • PTX ISA support: 3.2, 4.0, 4.1, 4.2, 4.3, 5.0, 6.0, 6.1, 6.3, 6.4, 6.5, 7.0, 7.1, 7.2
  • Device capability support: sm_37, sm_50, sm_52, sm_53, sm_60, sm_61, sm_62, sm_70, sm_72, sm_75, sm_80, sm_86

1 device:
0: NVIDIA A40 (sm_86, 44.398 GiB / 44.988 GiB available)

Any help is appreciated.

Two more comments about the problem.

If I check the CUDA installation following the instructions on the ITensorGPU page, I get:

using CUDA.CUTENSOR
ERROR: UndefVarError: CUTENSOR not defined

Yet if I run the ITensorGPU tests one by one they all succeed:
julia> include(“.julia/packages/ITensorGPU/x16B1/test/test_cuitensor.jl”)
Test Summary: | Pass Total Time
cuITensor, Dense{Float64} storage | 327752 327752 1m33.1s
Test Summary: | Pass Total Time
cuITensor, Dense{ComplexF64} storage | 327752 327752 46.7s

Anyone that can help?

Hello @raffaele, I am currently working to fix the ITensorGPU tests. What your seeing is an artifact of Pkg.test() This function creates a new activated temporary directory when you call Pkg.test("ITensorGPU") and ignores the LocalPreferences.jl file created when you call CUDA.set_runtime_version!. There are a couple of ways to avoid this issue for now:

  1. If you run the tests using include("path/to/ITensorGPU/tests/runtests.jl") This can fix the problem. or
  2. If you grab the latest version of ITensorGPU, we restrict the version of CUDA.jl to v4.0 which downloads CUDA runtime v11 instead of v12.1 (which is what the latest CUDA@4.1.4 uses).

To answer your other question: there is no longer a CUDA.CUTENSOR package. The cuTENSOR portion of CUDA.jl was recently moved to its own project with the name change CUTENSOR -> cuTENSOR. To call CUDA with cuTENSOR use the julia commands

using CUDA
using cuTENSOR

Can you please forward me the information about which test fails?

@raffaele, to zoom out from the issue trying to get the tests to pass when running Pkg.test, are you able to use ITensorGPU effectively to run calculations, for example can you run DMRG on GPU (without QN symmetries)? If so, the issue is likely just a problem with how the tests are interpreting the CUDA version, as @kmp5 is describing, and not fundamentally an issue with your ability to use the package for your project.

Thank you very much for the explanation. Including the file directly does indeed work. Only 6 tests are broken, all from the test_cudiag.jl

include(“.julia/packages/ITensorGPU/x16B1/test/test_cudiag.jl”)
Test Summary: | Pass Broken Total Time
cuITensor Float64 Contractions | 5 1 6 0.0s
Test Summary: | Pass Broken Total Time
cuITensor ComplexF64 Contractions | 5 1 6 0.0s
Test Summary: | Pass Broken Total Time
cuITensor Float64, Float64 Contractions | 5 1 6 0.0s
Test Summary: | Pass Broken Total Time
cuITensor Float64, ComplexF64 Contractions | 5 1 6 0.0s
Test Summary: | Pass Broken Total Time
cuITensor ComplexF64, Float64 Contractions | 5 1 6 0.0s
Test Summary: | Pass Broken Total Time
cuITensor ComplexF64, ComplexF64 Contractions | 5 1 6 0.0s
4-element Vector{Any}:
Test.DefaultTestSet(“cuITensor Float64, Float64 Contractions”, Any[Test.DefaultTestSet(“Test contract cuITensors”, Any[Test.DefaultTestSet(“Test contract cuITensors (MatrixDiag → Matrix)", Any[], 1, false, false, true, 1.682069467152939e9, 1.682069467153417e9), Test.DefaultTestSet("Test contract cuDiagITensors (DiagDiag → Diag)”, Any, 1, false, false, true, 1.682069467153428e9, 1.682069467153549e9), Test.DefaultTestSet(“Test contract cuDiagITensors (UniformDiagDiag → Diag)", Any[], 2, false, false, true, 1.682069467153556e9, 1.682069467153844e9), Test.DefaultTestSet("Test contract cuITensors (MatrixUniformDiag → Matrix)”, Any[Test Broken
Expression: ≈(collect(cC), array(2.0 * cpu(replaceind(permute(Aij, j, i), i, i’))), atol = 0.0001)], 1, false, false, true, 1.682069467153851e9, 1.682069467154175e9)], 0, false, false, true, 1.68206946715276e9, 1.682069467154176e9)], 0, false, false, true, 1.682069467152742e9, 1.682069467154178e9)
Test.DefaultTestSet(“cuITensor Float64, ComplexF64 Contractions”, Any[Test.DefaultTestSet(“Test contract cuITensors”, Any[Test.DefaultTestSet(“Test contract cuITensors (MatrixDiag → Matrix)", Any[], 1, false, false, true, 1.682069467155263e9, 1.682069467155577e9), Test.DefaultTestSet("Test contract cuDiagITensors (DiagDiag → Diag)”, Any, 1, false, false, true, 1.682069467155584e9, 1.682069467155702e9), Test.DefaultTestSet(“Test contract cuDiagITensors (UniformDiagDiag → Diag)", Any[], 2, false, false, true, 1.68206946715573e9, 1.682069467155946e9), Test.DefaultTestSet("Test contract cuITensors (MatrixUniformDiag → Matrix)”, Any[Test Broken
Expression: ≈(collect(cC), array(2.0 * cpu(replaceind(permute(Aij, j, i), i, i’))), atol = 0.0001)], 1, false, false, true, 1.682069467155952e9, 1.682069467156641e9)], 0, false, false, true, 1.682069467155171e9, 1.682069467156642e9)], 0, false, false, true, 1.682069467155165e9, 1.682069467156645e9)
Test.DefaultTestSet(“cuITensor ComplexF64, Float64 Contractions”, Any[Test.DefaultTestSet(“Test contract cuITensors”, Any[Test.DefaultTestSet(“Test contract cuITensors (MatrixDiag → Matrix)", Any[], 1, false, false, true, 1.682069467157307e9, 1.682069467157562e9), Test.DefaultTestSet("Test contract cuDiagITensors (DiagDiag → Diag)”, Any, 1, false, false, true, 1.682069467157568e9, 1.682069467157669e9), Test.DefaultTestSet(“Test contract cuDiagITensors (UniformDiagDiag → Diag)", Any[], 2, false, false, true, 1.682069467157675e9, 1.6820694671579e9), Test.DefaultTestSet("Test contract cuITensors (MatrixUniformDiag → Matrix)”, Any[Test Broken
Expression: ≈(collect(cC), array(2.0 * cpu(replaceind(permute(Aij, j, i), i, i’))), atol = 0.0001)], 1, false, false, true, 1.682069467157905e9, 1.68206946716124e9)], 0, false, false, true, 1.682069467157227e9, 1.682069467161244e9)], 0, false, false, true, 1.682069467157221e9, 1.682069467161247e9)
Test.DefaultTestSet(“cuITensor ComplexF64, ComplexF64 Contractions”, Any[Test.DefaultTestSet(“Test contract cuITensors”, Any[Test.DefaultTestSet(“Test contract cuITensors (MatrixDiag → Matrix)", Any[], 1, false, false, true, 1.682069467163772e9, 1.682069467164366e9), Test.DefaultTestSet("Test contract cuDiagITensors (DiagDiag → Diag)”, Any, 1, false, false, true, 1.682069467164383e9, 1.682069467164601e9), Test.DefaultTestSet(“Test contract cuDiagITensors (UniformDiagDiag → Diag)", Any[], 2, false, false, true, 1.682069467164612e9, 1.682069467165051e9), Test.DefaultTestSet("Test contract cuITensors (MatrixUniformDiag → Matrix)”, Any[Test Broken
Expression: ≈(collect(cC), array(2.0 * cpu(replaceind(permute(Aij, j, i), i, i’))), atol = 0.0001)], 1, false, false, true, 1.682069467165063e9, 1.682069467167379e9)], 0, false, false, true, 1.682069467163555e9, 1.682069467167382e9)], 0, false, false, true, 1.68206946716354e9, 1.682069467167383e9)