{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl/issues/131","repository_url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl","labels_url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl/issues/131/comments","events_url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl/issues/131/events","html_url":"https://github.com/JuliaGPU/CuArrays.jl/issues/131","id":360614296,"node_id":"MDU6SXNzdWUzNjA2MTQyOTY=","number":131,"title":"too many resources requested for launch","user":{"login":"skariel","id":2347816,"node_id":"MDQ6VXNlcjIzNDc4MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/2347816?v=4","gravatar_id":"","url":"https://api.github.com/users/skariel","html_url":"https://github.com/skariel","followers_url":"https://api.github.com/users/skariel/followers","following_url":"https://api.github.com/users/skariel/following{/other_user}","gists_url":"https://api.github.com/users/skariel/gists{/gist_id}","starred_url":"https://api.github.com/users/skariel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skariel/subscriptions","organizations_url":"https://api.github.com/users/skariel/orgs","repos_url":"https://api.github.com/users/skariel/repos","events_url":"https://api.github.com/users/skariel/events{/privacy}","received_events_url":"https://api.github.com/users/skariel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-16T07:47:59Z","updated_at":"2019-01-03T15:22:23Z","closed_at":"2018-09-19T15:07:24Z","author_association":"NONE","body":"see error, and my setup below:\r\n\r\n## the error:\r\n```\r\nusing Statistics\r\nusing CuArrays\r\nstd(rand(Float32, 84,84,1,1,16) |> gpu, dims=(1,2,3,))\r\n```\r\ngives:\r\n```\r\nERROR: CUDA error: too many resources requested for launch (code #701, ERROR_LAUNCH_OUT_OF_RESOURCES)\r\nStacktrace:\r\n [1] macro expansion at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/base.jl:145 [inlined]\r\n [2] macro expansion at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:90 [inlined]\r\n [3] macro expansion at ./gcutils.jl:87 [inlined]\r\n [4] macro expansion at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:88 [inlined]\r\n [5] _launch at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:68 [inlined]\r\n [6] launch at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:60 [inlined]\r\n [7] macro expansion at ./gcutils.jl:87 [inlined]\r\n [8] macro expansion at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:171 [inlined]\r\n [9] #_cudacall#22(::Int64, ::Tuple{Int64,Int64,Int64}, ::Int64, ::CUDAdrv.CuStream, ::typeof(CUDAdrv._cudacall), ::CUDAdrv.CuFunction, ::Type{Tuple{CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global},CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global},CartesianIndices{5,NTuple{5,Base.OneTo{Int64}}},Int64,Int64}}, ::Tuple{CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global},CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global},CartesianIndices{5,NTuple{5,Base.OneTo{Int64}}},Int64,Int64}) at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:154\r\n [10] (::getfield(CUDAdrv, Symbol(\"#kw##_cudacall\")))(::NamedTuple{(:blocks, :threads),Tuple{Int64,Tuple{Int64,Int64,Int64}}}, ::typeof(CUDAdrv._cudacall), ::CUDAdrv.CuFunction, ::Type, ::Tuple{CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global},CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global},CartesianIndices{5,NTuple{5,Base.OneTo{Int64}}},Int64,Int64}) at ./none:0\r\n [11] #cudacall#21 at /home/skariel/.julia/packages/CUDAdrv/huk2n/src/execution.jl:146 [inlined]\r\n [12] #cudacall at ./none:0 [inlined]\r\n [13] macro expansion at /home/skariel/.julia/packages/CUDAnative/EsWDI/src/execution.jl:231 [inlined]\r\n [14] _cuda(::CUDAnative.KernelWrapper{typeof(CuArrays.mapreducedim_kernel_parallel)}, ::typeof(CuArrays.mapreducedim_kernel_parallel), ::Tuple{}, ::NamedTuple{(:blocks, :threads),Tuple{Int64,Tuple{Int64,Int64,Int64}}}, ::typeof(identity), ::typeof(Base.add_sum), ::CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global}, ::CUDAnative.CuDeviceArray{Float32,5,CUDAnative.AS.Global}, ::CartesianIndices{5,NTuple{5,Base.OneTo{Int64}}}, ::Int64, ::Int64) at /home/skariel/.julia/packages/CUDAnative/EsWDI/src/execution.jl:177\r\n [15] _mapreducedim!(::Function, ::Function, ::CuArray{Float32,5}, ::CuArray{Float32,5}) at /home/skariel/.julia/packages/CuArrays/usQs3/src/mapreduce.jl:67\r\n [16] mapreducedim! at ./reducedim.jl:271 [inlined]\r\n [17] #sum!#552 at ./reducedim.jl:667 [inlined]\r\n [18] #sum! at ./none:0 [inlined]\r\n [19] #sum!#553 at ./reducedim.jl:669 [inlined]\r\n [20] #sum! at ./none:0 [inlined]\r\n [21] mean!(::CuArray{Float32,5}, ::CuArray{Float32,5}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Statistics/src/Statistics.jl:100\r\n [22] _mean at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Statistics/src/Statistics.jl:130 [inlined]\r\n [23] #mean#1 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Statistics/src/Statistics.jl:128 [inlined]\r\n [24] (::getfield(Statistics, Symbol(\"#kw##mean\")))(::NamedTuple{(:dims,),Tuple{Tuple{Int64,Int64,Int64}}}, ::typeof(mean), ::CuArray{Float32,5}) at ./none:0\r\n [25] top-level scope at none:0\r\n```\r\nthe same happens with `mean`, and it does not happen if:\r\n```\r\nstd(rand(Float32, 84,84,1,1,16) |> gpu)\r\n```\r\n## My setup:\r\n\r\nGeForce GTX 1060 (6Gb memory)\r\nJulia 1.0 (release)\r\nUbuntu 18.04\r\nNVidia driver version: 396.54   \r\nCuda 9.2\r\n```\r\n(v1.0) pkg> status\r\n    Status `~/.julia/environments/v1.0/Project.toml`\r\n  [c5f51814] CUDAdrv v0.8.5\r\n  [be33ccc6] CUDAnative v0.8.10\r\n  [3a865a2d] CuArrays v0.7.3+ #master (https://github.com/JuliaGPU/CuArrays.jl.git)\r\n  [717857b8] DSP v0.5.1\r\n  [39dd38d3] Dierckx v0.4.0\r\n  [7a1cc6ca] FFTW v0.2.4\r\n  [587475ba] Flux v0.6.7+ #master (https://github.com/FluxML/Flux.jl.git)\r\n  [f6369f11] ForwardDiff v0.9.0\r\n  [0c68f7d7] GPUArrays v0.3.4+ #master (https://github.com/JuliaGPU/GPUArrays.jl.git)\r\n  [7073ff75] IJulia v1.11.1+ #master (https://github.com/JuliaLang/IJulia.jl.git)\r\n  [916415d5] Images v0.16.0\r\n  [033835bb] JLD2 v0.1.2\r\n  [1902f260] Knet v1.1.0+ #master (https://github.com/denizyuret/Knet.jl.git)\r\n  [b964fa9f] LaTeXStrings v1.0.2\r\n  [4d1e1d77] Nullables v0.0.8\r\n  [f0f68f2c] PlotlyJS v0.11.1\r\n  [91a5bcdd] Plots v0.20.2+ #master (https://github.com/JuliaPlots/Plots.jl.git)\r\n  [438e738f] PyCall v1.18.4\r\n  [d330b81b] PyPlot v2.6.3\r\n  [295af30f] Revise v0.7.10\r\n  [276daf66] SpecialFunctions v0.7.0\r\n  [37b6cedf] Traceur v0.2.0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl/issues/comments/451174972","html_url":"https://github.com/JuliaGPU/CuArrays.jl/issues/131#issuecomment-451174972","issue_url":"https://api.github.com/repos/JuliaGPU/CuArrays.jl/issues/131","id":451174972,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTE3NDk3Mg==","user":{"login":"maleadt","id":383068,"node_id":"MDQ6VXNlcjM4MzA2OA==","avatar_url":"https://avatars3.githubusercontent.com/u/383068?v=4","gravatar_id":"","url":"https://api.github.com/users/maleadt","html_url":"https://github.com/maleadt","followers_url":"https://api.github.com/users/maleadt/followers","following_url":"https://api.github.com/users/maleadt/following{/other_user}","gists_url":"https://api.github.com/users/maleadt/gists{/gist_id}","starred_url":"https://api.github.com/users/maleadt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maleadt/subscriptions","organizations_url":"https://api.github.com/users/maleadt/orgs","repos_url":"https://api.github.com/users/maleadt/repos","events_url":"https://api.github.com/users/maleadt/events{/privacy}","received_events_url":"https://api.github.com/users/maleadt/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T15:22:23Z","updated_at":"2019-01-03T15:22:23Z","author_association":"MEMBER","body":"Sorry for taking a while. The actual fix to this issue is in https://github.com/JuliaGPU/CuArrays.jl/pull/167, where we use kernel reflection to figure out the resource usage. That fix isn't part of a released version of CuArrays yet, so I'm afraid you'll have to wait (since Flux doesn't support CuArrays from master)."}}
{"actor":{"display_login":"maleadt"}}