Skip to content

Commit 152604c

Browse files
author
seppel
committed
lockup hack
1 parent 7785b74 commit 152604c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/io/cuda/cuda.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,15 +877,20 @@ static bool tryProcessCudaEvent(const SystemEvent &ev)
877877
ht_printf("process %d\n", ev.key.pressed);
878878
while (sys_get_hiresclk_ticks() < time_end) {
879879
sys_lock_mutex(gCUDAMutex);
880+
static int lockuphack = 0;
880881
if (gCUDA.state == cuda_idle) {
881882
if (!gCUDA.left /*&& !(gCUDA.rIFR & SR_INT)*/) {
883+
lockuphack = 0;
882884
bool k = doProcessCudaEvent(ev);
883885
sys_unlock_mutex(gCUDAMutex);
884886
// IO_CUDA_WARN("Tried to process event: %d.\n", k);
885887
return k;
886888
} else {
887889
IO_CUDA_WARN("left: %d\n", gCUDA.left);
888-
// pic_raise_interrupt(IO_PIC_IRQ_CUDA);
890+
if (lockuphack++ == 20) {
891+
gCUDA.left = 0;
892+
lockuphack = 0;
893+
}
889894
}
890895
} else {
891896
IO_CUDA_TRACE2("cuda not idle (%d)!\n", gCUDA.state);

0 commit comments

Comments
 (0)