CUDA error #218

GROMACS version:2025.3-conda_forge
GROMACS modification: Yes/No
Here post your question

Subject: CUDA Error #218 (cudaErrorInvalidPtx) with RTX 5060 when running gmx mdrun

Message:

Hello, I’m trying to run a molecular dynamics simulation using gmx mdrun but keep getting a CUDA error #218 with my new RTX 5060 GPU. The error occurs during the kernel launch and prevents the simulation from starting.

I’m using GROMACS 2025.3 installed via conda-forge with CUDA support. The GPU is detected correctly and the software recognizes it, but fails when trying to compile the PTX kernels. The specific error is: “GPU kernel (k_pruneonly) failed to launch: CUDA error #218 (cudaErrorInvalidPtx): a PTX JIT compilation failed.”

System configuration:

  • GPU: NVIDIA RTX 5060 (Blackwell architecture, compute capability 12.0)

  • GROMACS: 2025.3-conda_forge (nompi_cuda build)

  • CUDA runtime: 12.60, Driver: 13.0

  • Installation: conda install conda-forge::gromacs=2025.3=nompi_cuda_h7ac747b_0

What I’ve tried:

  • Different GPU flag combinations (-nb gpu -pme cpu, -nb gpu -pme auto)

  • Cleaned CUDA cache (rm -rf ~/.nv/)

  • Verified the GPU works with other CUDA applications

  • The simulation runs fine in CPU-only mode

Specific questions:

  1. Has anyone successfully run GROMACS on RTX 5060 or other Blackwell GPUs?

  2. Are there known issues with PTX JIT compilation on compute capability 12.0?

  3. Should I try manual compilation with specific architecture flags?

  4. Are there workarounds like environment variables or specific execution flags?

  5. Does the conda-forge build properly support sm_120 architecture?

The full error occurs during the k_pruneonly kernel launch. Any guidance would be greatly appreciated as I need to get this working for my research.

Thank you for your help!

this is the problem:


Program: gmx mdrun, version 2025.3-conda_forge
Source file: src/gromacs/gpu_utils/cudautils.cuh (line 281)
Function: launchGpuKernel<gmx::NBAtomDataGpu, gmx::NBParamGpu, gmx::GpuPairlist, int>(void ()(gmx::NBAtomDataGpu, gmx::NBParamGpu, gmx::GpuPairlist, int), const KernelLaunchConfig&, const DeviceStream&, CommandEvent, const char*, const std::array<void*, 4>&)::<lambda()>

Assertion failed:
Condition: stat == cudaSuccess
GPU kernel (k_pruneonly) failed to launch: CUDA error #218
(cudaErrorInvalidPtx): a PTX JIT compilation failed.

Hi,

CUDA Runtime 12.6 does not support RTX5060. You need CUDA 12.8 or newer: CUDA - Wikipedia

Please build GROMACS yourself with an appropriate CUDA version (12.8, 12.9, or 13.0 all should work).

To your specific questions:

Has anyone successfully run GROMACS on RTX 5060 or other Blackwell GPUs?

Yes.

Are there known issues with PTX JIT compilation on compute capability 12.0?

No.

Should I try manual compilation with specific architecture flags?

The problem is with CUDA version, so manually specifying architecture flags would just result in a more clear error message.

Are there workarounds like environment variables or specific execution flags?

No

Does the conda-forge build properly support sm_120 architecture?

Does not seem so. There is an open pull request enabling CUDA 13.0 for GROMACS Conda recipe (Upgrade to CUDA 13.0 by regro-cf-autotick-bot · Pull Request #81 · conda-forge/gromacs-feedstock · GitHub), so it will hopefully be resolved in the future.

1 Like

I already fixed it, the problem was that you have to install CUDA 13 and compile with DGMX_CUDA_TARGET_SM=‘90;100;120’ -DGMX_CUDA_TARGET_COMPUTE=‘90;100;120’

1 Like

FYI, the conda-forge build of GROMACS 2025.3 was updated to use CUDA 12.9, so it should now work on Blackwell GPUs fine.