| 1738 | } |
| 1739 | |
| 1740 | static bool ListCudaDevices() |
| 1741 | { |
| 1742 | int count = 0; |
| 1743 | cudaError_t err = cudaGetDeviceCount(&count); |
| 1744 | if (err != cudaSuccess) |
| 1745 | { |
| 1746 | fprintf(stderr, "Call to cudaGetDeviceCount failed, error code = %s.\n", cudaGetErrorName(err)); |
| 1747 | return false; |
| 1748 | } |
| 1749 | |
| 1750 | if (count == 0) |
| 1751 | { |
| 1752 | printf("No CUDA devices available.\n"); |
| 1753 | return true; |
| 1754 | } |
| 1755 | |
| 1756 | for (int device = 0; device < count; ++device) |
| 1757 | { |
| 1758 | cudaDeviceProp prop{}; |
| 1759 | err = cudaGetDeviceProperties(&prop, device); |
| 1760 | if (err != cudaSuccess) |
| 1761 | { |
| 1762 | fprintf(stderr, "Call to cudaGetDeviceProperties(%d) failed, error code = %s.\n", |
| 1763 | device, cudaGetErrorName(err)); |
| 1764 | return false; |
| 1765 | } |
| 1766 | |
| 1767 | printf("Device %d: %s (compute capability %d.%d, %zu MB VRAM)\n", device, prop.name, |
| 1768 | prop.major, prop.minor, prop.totalGlobalMem / (1024 * 1024)); |
| 1769 | } |
| 1770 | |
| 1771 | return true; |
| 1772 | } |
| 1773 | |
| 1774 | void OverrideBcFormats(ntc::ITextureSetMetadata* textureSetMetadata) |
| 1775 | { |