Skip to content

Do not initialize CUDA during precompilation #1597

@maleadt

Description

@maleadt

This is wrong:

if CUDA.functional() include("ctc-gpu.jl") end

This should be guarded by a check if !precompiling:

Flux.jl/src/Flux.jl

Lines 59 to 61 in 8a5b977

function __init__()
use_cuda[] = CUDA.functional() # Can be overridden after load with `Flux.use_cuda[] = false`
if CUDA.functional()

Additionally, this shouldn't be done during __init__, but lazily when first calling the gpu function.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions