mirror of
https://github.com/GOSTSec/ccminer
synced 2025-01-22 04:24:29 +00:00
cuda: ensure the system can find the right lib
if you get this error on linux, its because libcudart.so.x.x was not found ldconfig -p | grep libcudart.so.8.0
This commit is contained in:
parent
1d5db48797
commit
4d95ef4aec
16
cuda.cpp
16
cuda.cpp
@ -27,25 +27,21 @@ extern "C" {
|
|||||||
// CUDA Devices on the System
|
// CUDA Devices on the System
|
||||||
int cuda_num_devices()
|
int cuda_num_devices()
|
||||||
{
|
{
|
||||||
int version;
|
int version = 0, GPU_N = 0;
|
||||||
cudaError_t err = cudaDriverGetVersion(&version);
|
cudaError_t err = cudaDriverGetVersion(&version);
|
||||||
if (err != cudaSuccess)
|
if (err != cudaSuccess) {
|
||||||
{
|
|
||||||
applog(LOG_ERR, "Unable to query CUDA driver version! Is an nVidia driver installed?");
|
applog(LOG_ERR, "Unable to query CUDA driver version! Is an nVidia driver installed?");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int maj = version / 1000, min = version % 100; // same as in deviceQuery sample
|
if (version < CUDART_VERSION) {
|
||||||
if (maj < 5 || (maj == 5 && min < 5))
|
applog(LOG_ERR, "Your system does not support CUDA %d.%d API!",
|
||||||
{
|
CUDART_VERSION / 1000, (CUDART_VERSION % 1000) / 10);
|
||||||
applog(LOG_ERR, "Driver does not support CUDA %d.%d API! Update your nVidia driver!", 5, 5);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GPU_N;
|
|
||||||
err = cudaGetDeviceCount(&GPU_N);
|
err = cudaGetDeviceCount(&GPU_N);
|
||||||
if (err != cudaSuccess)
|
if (err != cudaSuccess) {
|
||||||
{
|
|
||||||
applog(LOG_ERR, "Unable to query number of CUDA devices! Is an nVidia driver installed?");
|
applog(LOG_ERR, "Unable to query number of CUDA devices! Is an nVidia driver installed?");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user