Summary
GPU/GPUEngine.cu does not compile against CUDA 13. cudaDeviceProp::computeMode was removed from the struct, and PrintCudaInfo() reads it.
Error
GPU/GPUEngine.cu(371): error: class "cudaDeviceProp" has no member "computeMode"
sComputeMode[deviceProp.computeMode]);
^
1 error detected in the compilation of "GPU/GPUEngine.cu".
This is the only source-level error nvcc 13.3.73 reports; with it fixed, GPUEngine.cu compiles clean.
Cause
The field is gone from cudaDeviceProp in CUDA 13. The cudaDevAttrComputeMode device attribute still exists (driver_types.h: cudaDevAttrComputeMode = 20), so the information is still available — just not through the struct.
The use is purely informational, one field of the startup banner.
Fix
cudaDeviceProp deviceProp;
cudaGetDeviceProperties(&deviceProp,i);
+
+ // cudaDeviceProp::computeMode was removed in CUDA 13; the device
+ // attribute still exists, so query that instead of the struct field.
+ int computeMode = 0;
+ cudaDeviceGetAttribute(&computeMode,cudaDevAttrComputeMode,i);
+ if(computeMode < 0 || computeMode > 3) computeMode = 4; // "Unknown"
+
printf("GPU #%d %s (%dx%d cores) (Cap %d.%d) (%.1f MB) (%s)\n",
i,deviceProp.name,deviceProp.multiProcessorCount,
_ConvertSMVer2Cores(deviceProp.major,deviceProp.minor),
deviceProp.major,deviceProp.minor,(double)deviceProp.totalGlobalMem / 1048576.0,
- sComputeMode[deviceProp.computeMode]);
+ sComputeMode[computeMode]);
The bounds guard matters because sComputeMode[] has 5 entries and nothing constrains the attribute to that range.
cudaDeviceGetAttribute is long-standing API, so this also builds on older toolkits — no version guard needed.
Environment
- CUDA 13.3.73, MSVC 14.44, Windows, sm_86 (RTX 3050 Laptop)
- Verified after the fix: builds clean,
-l prints the device correctly, and solves the sample in.txt key
Note
This is independent of everything else and stands alone. It is also included in PR #158, but that PR carries a breaking format change you may not want — this one-hunk fix is worth taking on its own regardless, since without it nobody can build the GPU version against a current toolkit.
Unrelated to the compile error, while in this file: _ConvertSMVer2Cores() has no entry for sm_86, so the banner prints (16x0 cores) on Ampere consumer cards. Cosmetic, but easy to fold in if you touch this function.
🤖 Generated with Claude Code
Summary
GPU/GPUEngine.cudoes not compile against CUDA 13.cudaDeviceProp::computeModewas removed from the struct, andPrintCudaInfo()reads it.Error
This is the only source-level error nvcc 13.3.73 reports; with it fixed,
GPUEngine.cucompiles clean.Cause
The field is gone from
cudaDevicePropin CUDA 13. ThecudaDevAttrComputeModedevice attribute still exists (driver_types.h:cudaDevAttrComputeMode = 20), so the information is still available — just not through the struct.The use is purely informational, one field of the startup banner.
Fix
cudaDeviceProp deviceProp; cudaGetDeviceProperties(&deviceProp,i); + + // cudaDeviceProp::computeMode was removed in CUDA 13; the device + // attribute still exists, so query that instead of the struct field. + int computeMode = 0; + cudaDeviceGetAttribute(&computeMode,cudaDevAttrComputeMode,i); + if(computeMode < 0 || computeMode > 3) computeMode = 4; // "Unknown" + printf("GPU #%d %s (%dx%d cores) (Cap %d.%d) (%.1f MB) (%s)\n", i,deviceProp.name,deviceProp.multiProcessorCount, _ConvertSMVer2Cores(deviceProp.major,deviceProp.minor), deviceProp.major,deviceProp.minor,(double)deviceProp.totalGlobalMem / 1048576.0, - sComputeMode[deviceProp.computeMode]); + sComputeMode[computeMode]);The bounds guard matters because
sComputeMode[]has 5 entries and nothing constrains the attribute to that range.cudaDeviceGetAttributeis long-standing API, so this also builds on older toolkits — no version guard needed.Environment
-lprints the device correctly, and solves the samplein.txtkeyNote
This is independent of everything else and stands alone. It is also included in PR #158, but that PR carries a breaking format change you may not want — this one-hunk fix is worth taking on its own regardless, since without it nobody can build the GPU version against a current toolkit.
Unrelated to the compile error, while in this file:
_ConvertSMVer2Cores()has no entry for sm_86, so the banner prints(16x0 cores)on Ampere consumer cards. Cosmetic, but easy to fold in if you touch this function.🤖 Generated with Claude Code