我将我的OpenCL和Cuda代码上传到hgpu.org,因为我的笔记本电脑上没有显卡.当我上传我的代码时,我收到以下错误:
make: Warning: File `main.cu' has modification time 381 s in the future
make: warning: Clock skew detected. Your build may be incomplete.
Run Code Online (Sandbox Code Playgroud)
我知道时钟偏差是由于我的机器时钟时间和服务器的时钟时间不同所以我将时间与服务器的时间同步.OpenCL和C++代码现在运行正常,但Cuda代码仍然给我这个错误.
所以我的问题是:
除了时间同步之外,还有其他原因造成时钟偏差吗?如果有,那我该如何解决呢?
Cuda代码:
__global__
void test()
{
}
int main()
{
dim3 gridblock(1,1,1);
dim3 threadblock(1,1,1);
test<<<gridblock,threadblock>>>();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
注意:我也可以提供make文件.
Mun*_*qar 12
Type the following command:
find . -exec touch \{\} \;
Run Code Online (Sandbox Code Playgroud)
(the first argument(s) to find specify the directory(s) to search)
小智 7
原因之一可能是您的电脑的日期/时间不正确。
在 Ubuntu PC 中使用以下命令检查日期和时间:
date
Run Code Online (Sandbox Code Playgroud)
例如,更新日期和时间的方法之一是:
date -s "23 MAR 2017 17:06:00"
Run Code Online (Sandbox Code Playgroud)
看到这篇文章:在远程Linux机器上编译C++ - "检测到时钟偏差"警告.
我建议只复制源代码(没有可执行文件),然后运行touch *将最后修改的时间设置为当前的hgpu.org服务器时间.不幸的是,这将迫使一切都重建.
出于好奇,在同步PC时间之后,main.cu的修改时间仍然是381秒吗?
我要回答我自己的问题。
我将以下代码行添加到我的 Makefile 中,它修复了“时钟偏差”问题:
clean:
find . -type f | xargs touch
rm -rf $(OBJS)
Run Code Online (Sandbox Code Playgroud)