1

Is there a way to disable the Just-In-Time compilation of PTX code to GPU assembly when running an application?

There are certain scenarios where one want to run a GPU-enabled application on CPU-only mode. If the application is big enough, and it is the first run of that version of executable, the JIT process may take a very long time (very common on CI/CD cases from my company)

648trindade
  • 689
  • 2
  • 5
  • 21
  • 1
    Is this possibly an XY-problem? Is JIT compilation strictly necessary (e.g. because of dynamically generated code) or does it happen because the fat binary build does not include machine code for all relevant GPU target platforms? What is "CI/CD"? – njuffa Nov 25 '21 at 20:52
  • @njuffa as the software is too big, compiling it to every necessary nvidia architecture is too costly in terms of time, so we compile ptx code for a single architecture. when I write CI/CD I was refering about a contínuous integration workflow (e.g. Jenkins jobs running tests on a build of a feature branch) – 648trindade Nov 26 '21 at 04:39

1 Answers1

5

The CUDA runtime will obey an environment variable to determine whether PTX JIT will take place or not. The following should prevent any JIT activity in your code:

CUDA_DISABLE_PTX_JIT=1 ./my_executable
Robert Crovella
  • 143,785
  • 11
  • 213
  • 257