Skip to content

Problem with conv4 on gpu #680

@andreasdominik

Description

@andreasdominik

Dear Deniz,

We are facing a strange problem with conv4 on gpu.
The code

> using Knet
> x = rand(Float32, 224,224,3,4) |> CuArray
> w = param(5,5,3,8)
> conv4(w,x)

generates the error:

MethodError: no method matching similar(::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}, ::Missing)

Stacktrace:
  [1] conv4_algo(w::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}, x::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}, y::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}; handle::Ptr{Nothing}, o::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Knet.Ops20_gpu ~/.julia/packages/Knet/YIFWC/src/ops20_gpu/conv.jl:166
  [2] conv4(w::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}, x::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}; handle::Ptr{Nothing}, alpha::Int64, o::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Knet.Ops20_gpu ~/.julia/packages/Knet/YIFWC/src/ops20_gpu/conv.jl:9
  [3] conv4(w::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}, x::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer})
    @ Knet.Ops20_gpu ~/.julia/packages/Knet/YIFWC/src/ops20_gpu/conv.jl:7
  [4] forw(::Function, ::Param{CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ AutoGrad ~/.julia/packages/AutoGrad/1QZxP/src/core.jl:66
  [5] forw
    @ ~/.julia/packages/AutoGrad/1QZxP/src/core.jl:65 [inlined]
  [6] #conv4#28
    @ ./none:0 [inlined]
  [7] conv4(w::Param{CuArray{Float32, 4, CUDA.Mem.DeviceBuffer}}, x::CuArray{Float32, 4, CUDA.Mem.DeviceBuffer})
    @ Knet.Ops20 ./none:0

Strange, because this happens on our Nvidia-Server but NOT on my local computer with identical installations of Julia and Knet.
Only difference is the Cuda-driver, which is

Driver Version: 460.91.03 CUDA Version: 11.2

on the nvidia-machine (with error) and Driver Version: 510.73.05 CUDA Version: 11.6 on my computer. Unfortunately it is not so easy to change the driver on the server, because of people are using a multitude of frameworks there.
Maybe (hopefully) you have an idea...

cordially (a)do

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions