# PTX JIT compilation failed on 5070Ti with GROMACS 2025

**URL:** https://gromacs.bioexcel.eu/t/ptx-jit-compilation-failed-on-5070ti-with-gromacs-2025/12350
**Category:** User discussions
**Created:** [July 9, 2025, 1:17pm UTC](https://gromacs.bioexcel.eu/t/ptx-jit-compilation-failed-on-5070ti-with-gromacs-2025/12350 "2025-07-09T13:17:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)
#### Post date: [July 9, 2025, 1:17pm UTC](https://gromacs.bioexcel.eu/t/ptx-jit-compilation-failed-on-5070ti-with-gromacs-2025/12350/1 "2025-07-09T13:17:20Z")

</div>

GROMACS version: 2025.2  
GROMACS modification: No

When trying to launch a simulation on a node with RTX 5070Ti GPU, I get an ‘invalid PTX’ CUDA error:

```auto
 1 GPU selected for this run.
Mapping of GPU IDs to the 2 GPU tasks in the 1 rank on this node:
  PP:0,PME:0
PP tasks will do (non-perturbed) short-ranged interactions on the GPU
PP task will update and constrain coordinates on the CPU
PME tasks will do all aspects on the GPU
Using 1 MPI thread
Using 16 OpenMP threads 

starting mdrun 'Protein'
10000 steps, 40.0 ps.

-------------------------------------------------------
Program: gmx mdrun, version 2025.2-dev-20250512-0eaa03516a
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.

```

I used CUDA 12.2 for building GROMACS.

Carsten

---

<div class="post-metadata">

### Author: ![kazan](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@kazan](https://gromacs.bioexcel.eu/u/kazan)
#### Post date: [August 29, 2025, 3:46pm UTC](https://gromacs.bioexcel.eu/t/ptx-jit-compilation-failed-on-5070ti-with-gromacs-2025/12350/2 "2025-08-29T15:46:52Z")

</div>

I used Cuda 12.9 and Gromacs 2025.2 and got the same error. Try adding an explicit gpu architecture when cmake:

```auto
-DGMX_CUDA_TARGET_SM='90;100;120' -DGMX_CUDA_TARGET_COMPUTE='90;100;120'

```

This solved my problem.

Related links:

> <https://github.com/spack/spack/issues/18239#issuecomment-680108397>
>
> Omitting a lot, as I believe nvcc from cuda-11.x simply will not generate comput…e\_30 code, thus the error message.
> 
> See http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
> 
> Default solution is to just remove compute\_30. More complex would be to allow different CUDA versions and adjust the generated code to match.
> 
> 
> 
> \### Steps to reproduce the issue
> 
> 
> \`\`\`console
> $ spack install gromacs +cuda
> 
> 474 /gpfs/packages/spack/spack/opt/spack/linux-rhel7-broadwell/gcc-8.2.0/cuda-11.0.2-tlog2jv6ze6lfxk47omkfabtz7474gbw/bin/nvcc -M -D\_\_CUDACC\_\_ /tmp/swmgr/s
> pack-stage/spack-stage-gromacs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-src/src/gromacs/nbnxm/cuda/nbnxm\_cuda.cu -o /tmp/swmgr/spack-stage/spack-s
> tage-gromacs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-build/src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/libgromacs\_generated\_nbnxm\_cuda.cu.o.
> NVCC-depend -ccbin /gpfs/packages/spack/spack/opt/spack/linux-rhel7-x86\_64/gcc-7.3.0/gcc-8.2.0-kot2sql3i2pckkfopvmxdmbdopuwy42t/bin/g++ -m64 -Dlibgroma
> cs\_EXPORTS -DHAVE\_CONFIG\_H -DGMX\_DOUBLE=0 -DUSE\_STD\_INTTYPES\_H -Xcompiler ,\\"-mavx2\\",\\"-mfma\\",\\"-pthread\\",\\"-fPIC\\",\\"-O2\\",\\"-g\\",\\"-DNDEBUG\\",\\"-f
> excess-precision=fast\\",\\"-funroll-all-loops\\" -gencode arch=compute\_30,code=sm\_30 -gencode arch=compute\_35,code=sm\_35 -gencode arch=compute\_37,code=sm
> \_37 -gencode arch=compute\_50,code=sm\_50 -gencode arch=compute\_52,code=sm\_52 -gencode arch=compute\_60,code=sm\_60 -gencode arch=compute\_61,code=sm\_61 -ge
> ncode arch=compute\_70,code=sm\_70 -gencode arch=compute\_35,code=compute\_35 -gencode arch=compute\_50,code=compute\_50 -gencode arch=compute\_52,code=comput
> e\_52 -gencode arch=compute\_60,code=compute\_60 -gencode arch=compute\_61,code=compute\_61 -gencode arch=compute\_70,code=compute\_70 -gencode arch=compute\_7
> 5,code=compute\_75 -use\_fast\_math -DNVCC -I/gpfs/packages/spack/spack/opt/spack/linux-rhel7-broadwell/gcc-8.2.0/cuda-11.0.2-tlog2jv6ze6lfxk47omkfabtz747
> 4gbw/include -I/tmp/swmgr/spack-stage/spack-stage-gromacs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-src/src/external/thread\_mpi/include -I/tmp/swmg
> r/spack-stage/spack-stage-gromacs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-build/src -I/tmp/swmgr/spack-stage/spack-stage-gromacs-2020.3-2lg7rupv7
> untnzai2yrdnef7nklow2mc/spack-src/src -I/gpfs/packages/spack/spack/opt/spack/linux-rhel7-broadwell/gcc-8.2.0/openmpi-3.1.6-tg6m4mmn2p3vxbdpopsqgfesihlm
> 3g5f/include -I/gpfs/packages/spack/spack/opt/spack/linux-rhel7-broadwell/gcc-8.2.0/hwloc-1.11.11-s54td4k4foxz3kdukoesox46risjltch/include -I/usr/inclu
> de -I/tmp/swmgr/spack-stage/spack-stage-gromacs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-src/src/external -I/tmp/swmgr/spack-stage/spack-stage-gro
> macs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-src/src/external/tng\_io/include -I/tmp/swmgr/spack-stage/spack-stage-gromacs-2020.3-2lg7rupv7untnzai
> 2yrdnef7nklow2mc/spack-build/tng/include -I/tmp/swmgr/spack-stage/spack-stage-gromacs-2020.3-2lg7rupv7untnzai2yrdnef7nklow2mc/spack-src/src/external/lm
> fit
> 475 nvcc fatal : Unsupported gpu architecture 'compute\_30'
> 
> 
> \`\`\`
> 
> \### Information on your system
> 
> 
> 
> 
> 
> \### Additional information
> 
> 
> \* \[spack-build-out.txt\]()
> \* \[spack-build-env.txt\]()
> 
> 
> 
> \### General information
> 
> 
> \- \[\] I have run \`spack debug report\` and reported the version of Spack/Python/Platform
> \- \[\] I have run \`spack maintainers \<name-of-the-package\>\` and @mentioned any maintainers
> \- \[\] I have uploaded the build log and environment files
> \- \[\] I have searched the issues of this repo and believe this is not a duplicate

> **[Matching CUDA arch and CUDA gencode for various NVIDIA architectures - Arnon...](https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/)**
>
> This guide lists the various supported nvcc cuda gencode and cuda arch flags that can be used to compile your GPU code for several different GPUs

---

<div class="post-metadata">

### Author: ![Lgsus555](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Lgsus555](https://gromacs.bioexcel.eu/u/Lgsus555)
#### Post date: [September 26, 2025, 10:43pm UTC](https://gromacs.bioexcel.eu/t/ptx-jit-compilation-failed-on-5070ti-with-gromacs-2025/12350/3 "2025-09-26T22:43:23Z")

</div>

Were you able to fix it? I’m having the same problem with the 5060.

If you solved it, could you explain what you did? I’m very new to this.

---

<div class="post-metadata">

### Author: ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)
#### Post date: [September 30, 2025, 2:07pm UTC](https://gromacs.bioexcel.eu/t/ptx-jit-compilation-failed-on-5070ti-with-gromacs-2025/12350/4 "2025-09-30T14:07:33Z")

</div>

My problem vanished after upgrading from CUDA 12.2 to 12.8 and from GROMACS 2025.2 to 2025.3. I believe the relevant step was the CUDA upgrade to 12.8 which then means that on the 5070Ti you don’t rely on generating code from PTX any more.
