inducer / pycuda

CUDA integration for Python, plus shiny features
http://mathema.tician.de/software/pycuda
Other
1.85k stars 288 forks source link

CUDA 12 has removed enum values CU_TARGET_COMPUTE_20 and CU_TARGET_COMPUTE_21 #402

Closed mmohrhard closed 1 year ago

mmohrhard commented 1 year ago

Currently compiling pycuda against CUDA 12 fails as CUDA 12 has removed the CU_TARGET_COMPUTE_21 and CU_TARGET_COMPUTE_20 enums entries from CUjit_target_enum

To reproduce compile pycuda against CUDA 12.0. Otherwise, it can also be seen by downloading the cudart tarball from https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/linux-x86_64/cuda_cudart-linux-x86_64-12.0.107-archive.tar.xz and check the cuda.h file.

Here is the corresponding part of the file:

 1342 typedef enum CUjit_target_enum
 1343 {
 1344     CU_TARGET_COMPUTE_30 = 30,       /**< Compute device class 3.0 */
 1345     CU_TARGET_COMPUTE_32 = 32,       /**< Compute device class 3.2 */
 1346     CU_TARGET_COMPUTE_35 = 35,       /**< Compute device class 3.5 */
 1347     CU_TARGET_COMPUTE_37 = 37,       /**< Compute device class 3.7 */
 1348     CU_TARGET_COMPUTE_50 = 50,       /**< Compute device class 5.0 */
 1349     CU_TARGET_COMPUTE_52 = 52,       /**< Compute device class 5.2 */
 1350     CU_TARGET_COMPUTE_53 = 53,       /**< Compute device class 5.3 */
 1351     CU_TARGET_COMPUTE_60 = 60,       /**< Compute device class 6.0.*/
 1352     CU_TARGET_COMPUTE_61 = 61,       /**< Compute device class 6.1.*/
 1353     CU_TARGET_COMPUTE_62 = 62,       /**< Compute device class 6.2.*/
 1354     CU_TARGET_COMPUTE_70 = 70,       /**< Compute device class 7.0.*/
 1355     CU_TARGET_COMPUTE_72 = 72,       /**< Compute device class 7.2.*/
 1356     CU_TARGET_COMPUTE_75 = 75,       /**< Compute device class 7.5.*/
 1357     CU_TARGET_COMPUTE_80 = 80,       /**< Compute device class 8.0.*/
 1358     CU_TARGET_COMPUTE_86 = 86,       /**< Compute device class 8.6.*/
 1359     CU_TARGET_COMPUTE_87 = 87,       /**< Compute device class 8.7.*/
 1360     CU_TARGET_COMPUTE_89 = 89,       /**< Compute device class 8.9.*/
 1361     CU_TARGET_COMPUTE_90 = 90,        /**< Compute device class 9.0.*/
 1362 
 1363     /**< Compute device class 9.0. with accelerated features.*/
 1364     CU_TARGET_COMPUTE_90A = CU_COMPUTE_ACCELERATED_TARGET_BASE + CU_TARGET_COMPUTE_90
 1365 } CUjit_target;

And the corresponding compile error:

      src/wrapper/wrap_cudadrv.cpp:1034:26: error: ‘CU_TARGET_COMPUTE_20’ was not declared in this scope; did you mean ‘CU_TARGET_COMPUTE_90’?
       1034 |     .value("COMPUTE_20", CU_TARGET_COMPUTE_20)
            |                          ^~~~~~~~~~~~~~~~~~~~
            |                          CU_TARGET_COMPUTE_90
      src/wrapper/wrap_cudadrv.cpp:1037:26: error: ‘CU_TARGET_COMPUTE_21’ was not declared in this scope; did you mean ‘CU_TARGET_COMPUTE_61’?
       1037 |     .value("COMPUTE_21", CU_TARGET_COMPUTE_21)
            |                          ^~~~~~~~~~~~~~~~~~~~
            |                          CU_TARGET_COMPUTE_61

Expected behavior pycuda should compile against CUDA 12

Environment (please complete the following information):

inducer commented 1 year ago

Thanks for the report.

https://gitlab.tiker.net/inducer/pycuda/-/merge_requests/87 should address this.

I'll do a release once it's in.

inducer commented 1 year ago

https://pypi.org/project/pycuda/2022.2.1/