Skip to content

Running Oceananigans on Different GPUs #3786

Discussion options

You must be logged in to vote

Hi @RicksterB57 I think you're looking for the CUDA_VISIBLE_DEVICES environment variable.

For example, if you run Julia with CUDA_VISIBLE_DEVICES=0 julia then CUDA.jl will only see and use GPU 0. You can see which GPU got assigned which number with the nvidia-smi command.

This isn't just Julia-specific and you can find more info on: https://stackoverflow.com/questions/39649102/how-do-i-select-which-gpu-to-run-a-job-on

You can also control which GPU is being used inside Julia with the device! function. See: https://cuda.juliagpu.org/stable/usage/multigpu/

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RicksterB57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants