Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cusparseCreate(): CUDA context cannot be initialized #15

Open
michii-h opened this issue Feb 13, 2025 · 0 comments
Open

cusparseCreate(): CUDA context cannot be initialized #15

michii-h opened this issue Feb 13, 2025 · 0 comments

Comments

@michii-h
Copy link

Hello,

thanks for the work on this project, it looks promising!
I'm currently in the process of trying to use this solver, but I get this error:

 ** On entry to cusparseCreate(): CUDA context cannot be initialized

ERROR: CUSPARSEError: initialization error (code 1, CUSPARSE_STATUS_NOT_INITIALIZED)
Stacktrace:
  [1] throw_api_error(res::CUDA.CUSPARSE.cusparseStatus_t)
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/libcusparse.jl:14
  [2] check
    @ ~/.julia/packages/CUDA/1kIOw/lib/cusparse/libcusparse.jl:27 [inlined]
  [3] cusparseCreate
    @ ~/.julia/packages/CUDA/1kIOw/lib/utils/call.jl:34 [inlined]
  [4] cusparseCreate()
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/management.jl:5
  [5] #1448
    @ ~/.julia/packages/CUDA/1kIOw/lib/cusparse/CUSPARSE.jl:62 [inlined]
  [6] #context!#990
    @ ~/.julia/packages/CUDA/1kIOw/lib/cudadrv/state.jl:168 [inlined]
  [7] context!
    @ ~/.julia/packages/CUDA/1kIOw/lib/cudadrv/state.jl:163 [inlined]
  [8] handle_ctor(ctx::CuContext)
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/CUSPARSE.jl:61
  [9] pop!(cache::CUDA.APIUtils.HandleCache{CuContext, Ptr{CUDA.CUSPARSE.cusparseContext}}, key::CuContext)
    @ CUDA.APIUtils ~/.julia/packages/CUDA/1kIOw/lib/utils/cache.jl:52
 [10] (::CUDA.CUSPARSE.var"#new_state#1456")(cuda::@NamedTuple{…})
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/CUSPARSE.jl:83
 [11] #1454
    @ ~/.julia/packages/CUDA/1kIOw/lib/cusparse/CUSPARSE.jl:93 [inlined]
 [12] get!(default::CUDA.CUSPARSE.var"#1454#1458"{…}, h::Dict{…}, key::CuContext)
    @ Base ./dict.jl:458
 [13] handle()
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/CUSPARSE.jl:92
 [14] (::CUDA.CUSPARSE.var"#bufferSize#1230"{…})()
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/conversions.jl:356
 [15] get_size_gpu
    @ ~/.julia/packages/CUDA/1kIOw/lib/utils/call.jl:98 [inlined]
 [16] with_workspaces(f::CUDA.CUSPARSE.var"#1227#1231"{…}, cache_gpu::Nothing, cache_cpu::Nothing, size_gpu::CUDA.CUSPARSE.var"#bufferSize#1230"{…}, size_cpu::Int64)
    @ CUDA.APIUtils ~/.julia/packages/CUDA/1kIOw/lib/utils/call.jl:101
 [17] with_workspace
    @ ~/.julia/packages/CUDA/1kIOw/lib/utils/call.jl:67 [inlined]
 [18] (CUDA.CUSPARSE.CuSparseMatrixCSR{…})(csc::CUDA.CUSPARSE.CuSparseMatrixCSC{…}; index::Char, action::CUDA.CUSPARSE.cusparseAction_t, algo::CUDA.CUSPARSE.cusparseCsr2CscAlg_t)
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/conversions.jl:361
 [19] CuSparseMatrixCSR
    @ ~/.julia/packages/CUDA/1kIOw/lib/cusparse/conversions.jl:349 [inlined]
 [20] CuSparseMatrixCSR
    @ ~/.julia/packages/CUDA/1kIOw/lib/cusparse/array.jl:470 [inlined]
 [21] CuSparseMatrixCSR
    @ ~/.julia/packages/CUDA/1kIOw/lib/cusparse/array.jl:463 [inlined]
 [22] CUDA.CUSPARSE.CuSparseMatrixCSR(x::SparseArrays.SparseMatrixCSC{Float64, Int64})
    @ CUDA.CUSPARSE ~/.julia/packages/CUDA/1kIOw/lib/cusparse/array.jl:470
 [23] gpu_data_copy!(data::Clarabel.DefaultProblemData{Float64})
    @ Clarabel ~/.julia/dev/Clarabel/src/solver.jl:575
 [24] macro expansion
    @ ~/.julia/dev/Clarabel/src/solver.jl:127 [inlined]
 [25] macro expansion
    @ ~/.julia/packages/TimerOutputs/6KVfH/src/TimerOutput.jl:237 [inlined]
 [26] macro expansion
    @ ~/.julia/dev/Clarabel/src/solver.jl:125 [inlined]
 [27] macro expansion
    @ ~/.julia/packages/TimerOutputs/6KVfH/src/TimerOutput.jl:237 [inlined]
 [28] setup!(s::Clarabel.Solver{…}, P::SparseArrays.SparseMatrixCSC{…}, q::Vector{…}, A::SparseArrays.SparseMatrixCSC{…}, b::Vector{…}, cones::Vector{…})
    @ Clarabel ~/.julia/dev/Clarabel/src/solver.jl:95
 [29] setup!
    @ ~/.julia/dev/Clarabel/src/solver.jl:66 [inlined]
 [30] Clarabel.Solver(P::SparseArrays.SparseMatrixCSC{…}, c::Vector{…}, A::SparseArrays.SparseMatrixCSC{…}, b::Vector{…}, cones::Vector{…}, kwargs::Clarabel.Settings{…})
    @ Clarabel ~/.julia/dev/Clarabel/src/solver.jl:15
 [31] copy_to(dest::Clarabel.MOIwrapper.Optimizer{…}, src::MathOptInterface.Utilities.UniversalFallback{…})
    @ Clarabel.MOIwrapper ~/.julia/dev/Clarabel/src/MOI_wrapper/MOI_wrapper.jl:377
 [32] optimize!
    @ ~/.julia/packages/MathOptInterface/MQX8C/src/MathOptInterface.jl:121 [inlined]
 [33] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{…})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/MQX8C/src/Utilities/cachingoptimizer.jl:321
 [34] optimize!
    @ ~/.julia/packages/MathOptInterface/MQX8C/src/Bridges/bridge_optimizer.jl:367 [inlined]
 [35] optimize!
    @ ~/.julia/packages/MathOptInterface/MQX8C/src/MathOptInterface.jl:122 [inlined]
 [36] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{…})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/MQX8C/src/Utilities/cachingoptimizer.jl:321
 [37] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::@Kwargs{})
    @ JuMP ~/.julia/packages/JuMP/xlp0s/src/optimizer_interface.jl:595
 [38] optimize!
    @ ~/.julia/packages/JuMP/xlp0s/src/optimizer_interface.jl:546 [inlined]

I'm running this on a NVIDIA Jetson AGX Orin, with CUDA Toolkit installed.

julia> CUDA.versioninfo()
CUDA runtime 11.8, artifact installation
CUDA driver 11.4
Unknown NVIDIA driver

CUDA libraries: 
- CUBLAS: 11.6.6
- CURAND: 10.3.0
- CUFFT: 10.9.0
- CUSOLVER: 11.4.1
- CUSPARSE: 11.7.5
- CUPTI: 2022.3.0 (API 18.0.0)
- NVML: missing

Julia packages: 
- CUDA: 5.6.1
- CUDA_Driver_jll: 0.10.4+0
- CUDA_Runtime_jll: 0.15.5+0

Toolchain:
- Julia: 1.11.3
- LLVM: 16.0.6

1 device:
  0: Orin (sm_87, 51.900 GiB / 61.329 GiB available)

Do you have an idea how to resolve this?
Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant