You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a stackoverflow when I use a custom struct in combination with Adapt and CuTexture when it is printed to the REPL
I tested CUDA v3.5 and v4.0.1
To reproduce
The Minimal Working Example (MWE) for this bug:
using CUDA, Adapt
struct MyStruct{T}
code::Tend
mystruct =MyStruct(
CuTexture(
CuTextureArray(CuArray(randn(Float32, 4000, 30))),
address_mode = CUDA.ADDRESS_MODE_WRAP,
interpolation = CUDA.NearestNeighbour()
)
)
Adapt.@adapt_structure MyStruct
A =cudaconvert(mystruct); # works fine with semicolonshow(A);
Error:
MyStruct{CuDeviceTexture{Float32, 2, CUDA.ArrayMemory, false, CUDA.NearestNeighbour}}(Float32[Internal error: encountered unexpected error during compilation of LLVMException:StackOverflowError()
signal (11): Segmentation fault
in expression starting at none:0
signal (6): Aborted
in expression starting at none:0
Aborted (core dumped)
Device structures are not intended to be used on the CPU. Their functionality is strictly meant for use on the GPU, and calling functions (like getindex here) may just crash your session. We could make each of those definitions a @device_function, but that's a bit of a bother (and breaks tools like Revise.jl).
Why are you attempting to use this object on the CPU? You generally shouldn't ever need to call cudaconvert.
maleadt
changed the title
Stackoverflow when using custom struct with adapt and CuTexture while printing
CuDeviceTexture getindex breaks when executed on the CPU
Feb 6, 2023
Describe the bug
I get a stackoverflow when I use a custom struct in combination with Adapt and CuTexture when it is printed to the REPL
I tested CUDA v3.5 and v4.0.1
To reproduce
The Minimal Working Example (MWE) for this bug:
Error:
This throws a stackoverflow as well:
Manifest
Version info
Details on Julia:
Details on CUDA:
The text was updated successfully, but these errors were encountered: