diff --git a/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu b/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu index e466d77d0b..fc2ae8ff69 100644 --- a/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu +++ b/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu @@ -443,6 +443,7 @@ uint32_t get_lwe_chunk_size(uint32_t gpu_index, uint32_t max_num_pbs, int max_blocks_per_sm; int max_shared_memory = cuda_get_max_shared_memory(0); + cudaSetDevice(gpu_index); if (max_shared_memory < full_sm_keybundle) cudaOccupancyMaxActiveBlocksPerMultiprocessor( &max_blocks_per_sm,