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

Error in CuArrays.CuArray #34

Open
sepehr3pehr opened this issue Feb 28, 2019 · 7 comments
Open

Error in CuArrays.CuArray #34

sepehr3pehr opened this issue Feb 28, 2019 · 7 comments

Comments

@sepehr3pehr
Copy link

sepehr3pehr commented Feb 28, 2019

When running demos_train_query_base.jl, I get the following error in line 65 of encode_icm_cuda_single:

WARNING: CuArrays.BLAS is deprecated, use CUBLAS instead.
  likely near /home/sepehr/mcq/demos_train_query_base.jl:174
ERROR: LoadError: MethodError: no method matching CuArrays.CuArray{Float32,N} where N(::Int64)
Closest candidates are:
  CuArrays.CuArray{Float32,N} where N(!Matched::AbstractArray{S,N}) where {T, N, S} at /home/sepehr/.julia/packages/CuArrays/PD3UJ/src/array.jl:93
  CuArrays.CuArray{Float32,N} where N(!Matched::LinearAlgebra.UniformScaling, !Matched::Tuple{Int64,Int64}) at /home/sepehr/.julia/packages/GPUArrays/t8tJB/src/construction.jl:30
  CuArrays.CuArray{Float32,N} where N(!Matched::LinearAlgebra.UniformScaling, !Matched::Integer, !Matched::Integer) at /home/sepehr/.julia/packages/GPUArrays/t8tJB/src/construction.jl:34
  ...
Stacktrace:
 [1] encode_icm_cuda_single(::Array{Float32,2}, ::Array{Int16,2}, ::Array{Array{Float32,2},1}, ::Array{Int64,1}, ::Int64, ::Int64, ::Bool, ::Bool) at /home/sepehr/.julia/dev/Rayuela/src/LSQ_GPU.jl:65
 [2] encode_icm_cuda(::Array{Float32,2}, ::Array{Int16,2}, ::Array{Array{Float32,2},1}, ::Array{Int64,1}, ::Int64, ::Int64, ::Bool, ::Int64, ::Bool) at /home/sepehr/.julia/dev/Rayuela/src/LSQ_GPU.jl:231
 [3] train_lsq_cuda(::Array{Float32,2}, ::Int64, ::Int64, ::Array{Float32,2}, ::Array{Int16,2}, ::Array{Array{Float32,2},1}, ::Int64, ::Int64, ::Int64, ::Bool, ::Int64, ::Int64, ::Bool) at /home/sepehr/.julia/dev/Rayuela/src/LSQ_GPU.jl:300
 [4] experiment_lsq_cuda(::Array{Float32,2}, ::Array{Int16,2}, ::Array{Array{Float32,2},1}, ::Array{Float32,2}, ::Array{Float32,2}, ::Array{Float32,2}, ::Array{UInt32,1}, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Bool, ::Int64, ::Int64, ::Int64, ::Int64, ::Bool) at /home/sepehr/.julia/dev/Rayuela/src/LSQ_GPU.jl:345
 [5] run_demos(::String, ::Int64, ::Int64, ::Int64, ::Int64) at /home/sepehr/mcq/demos_train_query_base.jl:76
 [6] top-level scope at /home/sepehr/mcq/demos_train_query_base.jl:175 [inlined]
 [7] top-level scope at ./none:0
 [8] include at ./boot.jl:326 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1038
 [10] include(::Module, ::String) at ./sysimg.jl:29
 [11] exec_options(::Base.JLOptions) at ./client.jl:267
 [12] _start() at ./client.jl:436
in expression starting at /home/sepehr/mcq/demos_train_query_base.jl:174
@una-dinosauria
Copy link
Owner

Hi @sepehr3pehr,

Sorry about this -- I reran that script a few days ago and it worked fine with Julia 1.0, so you may want to give that a quick try if you are using 1.1.

I'll look into a way to solve this such that the code can work with both versions.

@una-dinosauria
Copy link
Owner

Hey @sepehr3pehr -- I was wondering, did this solve the issue?

@sepehr3pehr
Copy link
Author

sepehr3pehr commented Mar 5, 2019

Hey @una-dinosauria, unfortunately no! On julia 1.0.2, I get the following error:

julia> develop https://github.com/una-dinosauria/Rayuela.jl.git

(v1.0) pkg> develop https://github.com/una-dinosauria/Rayuela.jl.git
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/una-dinosauria/Rayuela.jl.git`
[ Info: Path `/home/sepehr/.julia/dev/Rayuela` exists and looks like the correct package, using existing path instead of cloning
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CuArrays [3a865a2d]:
 CuArrays [3a865a2d] log:
 ├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled
 ├─restricted to versions * by Rayuela [84bd14ec], leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
 │ └─Rayuela [84bd14ec] log:
 │   ├─possible versions are: 0.0.0 or uninstalled
 │   └─Rayuela [84bd14ec] is fixed to version 0.0.0
 ├─restricted by julia compatibility requirements to versions: [0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled, leaving only versions: [0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
 ├─restricted by compatibility requirements with CUDAdrv [c5f51814] to versions: [0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled, leaving only versions: [0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
 │ └─CUDAdrv [c5f51814] log:
 │   ├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.4, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.4, 0.6.0-0.6.1, 0.7.0-0.7.8, 0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1] or uninstalled
 │   ├─restricted to versions * by Rayuela [84bd14ec], leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.4, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.4, 0.6.0-0.6.1, 0.7.0-0.7.8, 0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1]
 │   │ └─Rayuela [84bd14ec] log: see above
 │   ├─restricted by julia compatibility requirements to versions: [0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1] or uninstalled, leaving only versions: [0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1]
 │   ├─restricted by compatibility requirements with CuArrays [3a865a2d] to versions: [0.5.0-0.5.4, 0.6.0-0.6.1, 0.7.0-0.7.8, 0.8.0-0.8.6, 1.0.1], leaving only versions: [0.8.0-0.8.6, 1.0.1]
 │   │ └─CuArrays [3a865a2d] log: see above
 │   └─restricted by compatibility requirements with CUDAapi [3895d2a7] to versions: [0.1.0-0.1.1, 0.2.0-0.2.4, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.2, 0.7.8, 0.8.2-0.8.6, 0.9.0, 1.0.0-1.0.1] or uninstalled, leaving only versions: [0.8.2-0.8.6, 1.0.1]
 │     └─CUDAapi [3895d2a7] log:
 │       ├─possible versions are: [0.1.0-0.1.3, 0.2.0-0.2.1, 0.3.0-0.3.1, 0.4.0-0.4.3, 0.5.0-0.5.4, 0.6.0] or uninstalled
 │       ├─restricted by julia compatibility requirements to versions: [0.5.0-0.5.4, 0.6.0] or uninstalled
 │       ├─restricted by compatibility requirements with CuArrays [3a865a2d] to versions: [0.1.0-0.1.3, 0.2.0-0.2.1, 0.3.0-0.3.1, 0.4.0-0.4.3, 0.5.0-0.5.4, 0.6.0], leaving only versions: [0.5.0-0.5.4, 0.6.0]
 │       │ └─CuArrays [3a865a2d] log: see above
 │       └─restricted by compatibility requirements with CUDAdrv [c5f51814] to versions: [0.4.0-0.4.3, 0.5.0-0.5.4], leaving only versions: 0.5.0-0.5.4
 │         └─CUDAdrv [c5f51814] log: see above
 ├─restricted by compatibility requirements with CUDAapi [3895d2a7] to versions: [0.1.0-0.1.1, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled, leaving only versions: [0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
 │ └─CUDAapi [3895d2a7] log: see above
 └─restricted by compatibility requirements with ForwardDiff [f6369f11] to versions: [0.1.0-0.1.1, 0.2.0-0.2.1, 0.3.0, 0.4.0] or uninstalled — no versions left
   └─ForwardDiff [f6369f11] log:
     ├─possible versions are: [0.0.2-0.0.3, 0.1.0-0.1.8, 0.2.0-0.2.5, 0.3.0-0.3.5, 0.4.0-0.4.2, 0.5.0, 0.6.0, 0.7.0-0.7.5, 0.8.0-0.8.5, 0.9.0, 0.10.0-0.10.3] or uninstalled
     ├─restricted by julia compatibility requirements to versions: [0.9.0, 0.10.0-0.10.3] or uninstalled
     └─restricted by compatibility requirements with DiffRules [b552c78f] to versions: [0.0.2-0.0.3, 0.1.0-0.1.8, 0.2.0-0.2.5, 0.3.0-0.3.5, 0.4.0-0.4.2, 0.5.0, 0.6.0, 0.7.0-0.7.1] or uninstalled, leaving only versions: uninstalled
       └─DiffRules [b552c78f] log:
         ├─possible versions are: 0.0.1-0.0.10 or uninstalled
         └─restricted by julia compatibility requirements to versions: 0.0.8-0.0.10 or uninstalled

@una-dinosauria
Copy link
Owner

I just updated the Manifest file and the CI passed again, so maybe try updating the package and building it again.

cd ~/.julia/dev/Rayuela
git pull

Start julia and

> using Pkg
> Pkg.build("Rayuela")

This may take a few minutes to bring packages up to date, but hopefully will resolve the dependency issues.

@sepehr3pehr
Copy link
Author

" Pkg.build("Rayuela")" didn't work for me as it caused unresolved package error. I tried deleting the .julia folder and reinstalling the library but it again caused the same issue.
I am starting to think that there is something wrong with the Julia installation of the cluster that I am using. I will try to contact them to see if it can be resolved.

(v1.0) pkg> develop https://github.com/una-dinosauria/Rayuela.jl.git
Updating git-repo https://github.com/una-dinosauria/Rayuela.jl.git
Cloning default registries into /home/sepehr/.julia/registries
Cloning registry General from "https://github.com/JuliaRegistries/General.git"
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CuArrays [3a865a2d]:
CuArrays [3a865a2d] log:
├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled
├─restricted to versions * by Rayuela [84bd14ec], leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
│ └─Rayuela [84bd14ec] log:
│ ├─possible versions are: 0.0.0 or uninstalled
│ └─Rayuela [84bd14ec] is fixed to version 0.0.0
├─restricted by julia compatibility requirements to versions: [0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled, leaving only versions: [0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
├─restricted by compatibility requirements with CUDAdrv [c5f51814] to versions: [0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled, leaving only versions: [0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
│ └─CUDAdrv [c5f51814] log:
│ ├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.4, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.4, 0.6.0-0.6.1, 0.7.0-0.7.8, 0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1] or uninstalled
│ ├─restricted to versions * by Rayuela [84bd14ec], leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.4, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.4, 0.6.0-0.6.1, 0.7.0-0.7.8, 0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1]
│ │ └─Rayuela [84bd14ec] log: see above
│ ├─restricted by julia compatibility requirements to versions: [0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1] or uninstalled, leaving only versions: [0.8.0-0.8.6, 0.9.0, 1.0.0-1.0.1]
│ ├─restricted by compatibility requirements with CuArrays [3a865a2d] to versions: [0.5.0-0.5.4, 0.6.0-0.6.1, 0.7.0-0.7.8, 0.8.0-0.8.6, 1.0.1], leaving only versions: [0.8.0-0.8.6, 1.0.1]
│ │ └─CuArrays [3a865a2d] log: see above
│ └─restricted by compatibility requirements with CUDAapi [3895d2a7] to versions: [0.1.0-0.1.1, 0.2.0-0.2.4, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.2, 0.7.8, 0.8.2-0.8.6, 0.9.0, 1.0.0-1.0.1] or uninstalled, leaving only versions: [0.8.2-0.8.6, 1.0.1]
│ └─CUDAapi [3895d2a7] log:
│ ├─possible versions are: [0.1.0-0.1.3, 0.2.0-0.2.1, 0.3.0-0.3.1, 0.4.0-0.4.3, 0.5.0-0.5.4, 0.6.0] or uninstalled
│ ├─restricted by julia compatibility requirements to versions: [0.5.0-0.5.4, 0.6.0] or uninstalled
│ ├─restricted by compatibility requirements with CuArrays [3a865a2d] to versions: [0.1.0-0.1.3, 0.2.0-0.2.1, 0.3.0-0.3.1, 0.4.0-0.4.3, 0.5.0-0.5.4, 0.6.0], leaving only versions: [0.5.0-0.5.4, 0.6.0]
│ │ └─CuArrays [3a865a2d] log: see above
│ └─restricted by compatibility requirements with CUDAdrv [c5f51814] to versions: [0.4.0-0.4.3, 0.5.0-0.5.4], leaving only versions: 0.5.0-0.5.4
│ └─CUDAdrv [c5f51814] log: see above
├─restricted by compatibility requirements with CUDAapi [3895d2a7] to versions: [0.1.0-0.1.1, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1] or uninstalled, leaving only versions: [0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1]
│ └─CUDAapi [3895d2a7] log: see above
└─restricted by compatibility requirements with ForwardDiff [f6369f11] to versions: [0.1.0-0.1.1, 0.2.0-0.2.1, 0.3.0, 0.4.0] or uninstalled — no versions left
└─ForwardDiff [f6369f11] log:
├─possible versions are: [0.0.2-0.0.3, 0.1.0-0.1.8, 0.2.0-0.2.5, 0.3.0-0.3.5, 0.4.0-0.4.2, 0.5.0, 0.6.0, 0.7.0-0.7.5, 0.8.0-0.8.5, 0.9.0, 0.10.0-0.10.3] or uninstalled
├─restricted by julia compatibility requirements to versions: [0.9.0, 0.10.0-0.10.3] or uninstalled
└─restricted by compatibility requirements with DiffRules [b552c78f] to versions: [0.0.2-0.0.3, 0.1.0-0.1.8, 0.2.0-0.2.5, 0.3.0-0.3.5, 0.4.0-0.4.2, 0.5.0, 0.6.0, 0.7.0-0.7.1] or uninstalled, leaving only versions: uninstalled
└─DiffRules [b552c78f] log:
├─possible versions are: 0.0.1-0.0.10 or uninstalled
└─restricted by julia compatibility requirements to versions: 0.0.8-0.0.10 or uninstalled

@JakubHanko
Copy link

JakubHanko commented Sep 8, 2022

Hello, reviving an old thread.

Changing d_prevcost = CuArrays.CuArray{Cfloat}(n) to d_prevcost = CuArrays.CuArray{Cfloat}(undef, n) in LSQ_GPU.jl:66
has done the job for me, apparently. Same change for d_newcost. Letting everyone know in case someone stumbles upon this error just like I did.

@una-dinosauria
Copy link
Owner

Thanks for the fix @JakubHanko !

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

3 participants