Skip to content

BUG: CUDA_VERSION is set to 0 in sdist #4597

@leofang

Description

@leofang

I was investigating the bug reported in conda-forge/cupy-feedstock#98, and it turns out the reason is on Conda-Forge we built CuPy from sdist, but the source has CUDA_VERSION inlined to 0:

// cupy_backends/cuda/api/driver.cpp

/* ... */

static PyObject *__pyx_pf_13cupy_backends_4cuda_3api_6driver_2get_build_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_build_version", 0);

  /* "cupy_backends/cuda/api/driver.pyx":141
 * 
 * def get_build_version():
 *     return CUDA_VERSION             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

  /* "cupy_backends/cuda/api/driver.pyx":140
 * ###############################################################################
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUDA_VERSION
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* ... */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

I don't have a good solution or patch for now, as it seems to imply sdist should be generated per CUDA version. Perhaps I am overlooking some obvious fix?

cc: @jakirkham @kmaehashi

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions