# CUDA aware MPI works on system but not for Julia

**URL:** https://discourse.julialang.org/t/cuda-aware-mpi-works-on-system-but-not-for-julia/75060
**Category:** Julia at Scale
**Tags:** parallel, mpi
**Created:** [January 23, 2022, 9:39am UTC](https://discourse.julialang.org/t/cuda-aware-mpi-works-on-system-but-not-for-julia/75060 "2022-01-23T09:39:06Z")
**Posts on this page:** 1
**Showing post:** 20

<div class="post-metadata">

### Author: ![luraess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luraess/32/16189_2.png) [@luraess](https://discourse.julialang.org/u/luraess)
#### Post date: [January 23, 2022, 9:08pm UTC](https://discourse.julialang.org/t/cuda-aware-mpi-works-on-system-but-not-for-julia/75060/20 "2022-01-23T21:08:53Z")

</div>

A minor addition to @samo 's hints, you could try setting the CUDA memory pool to `none`:

```julia
export JULIA_CUDA_MEMORY_POOL=none

```

This may help for the CUDA-aware MPI error.

For the artifact download issue, I’d make sure, starting from scratch once more, to:

- Have MPI and CUDA on path (or module loaded) that were used to build the CUDA-aware MPI
- Make sure to have:

```julia
export JULIA_CUDA_MEMORY_POOL=none
export JULIA_MPI_BINARY=system
export JULIA_CUDA_USE_BINARYBUILDER=false

```

- Add CUDA and MPI packages in Julia. Build MPI.jl in verbose mode to check whether correct versions are built/used:

```julia
julia -e 'using Pkg; pkg"add CUDA"; pkg"add MPI"; Pkg.build("MPI"; verbose=true)'

```

- Then in Julia, upon loading MPI and CUDA modules, you can check
  - CUDA version: `CUDA.versioninfo()`
  - If MPI has CUDA: `MPI.has_cuda()`
  - If you are using correct MPI implementation: `MPI.identify_implementation()`

After that, running the simple test script @samo suggested [here](https://discourse.julialang.org/t/cuda-aware-mpi-works-on-system-but-not-for-julia/75060/11?), launching it from a shell script as in [here](https://discourse.julialang.org/t/cuda-aware-mpi-works-on-system-but-not-for-julia/75060/4?) should make it.

---

_[View the full topic](https://discourse.julialang.org/t/cuda-aware-mpi-works-on-system-but-not-for-julia/75060)._
