diff --git a/scripts/generate-conda-envs.py b/scripts/generate-conda-envs.py index 9374ac63f..f32d606b0 100755 --- a/scripts/generate-conda-envs.py +++ b/scripts/generate-conda-envs.py @@ -71,17 +71,18 @@ def conda(self) -> Reqs: "pynvml", # tests ) - # gcc 11.3 is incompatible with nvcc <= 11.5. - if ( - self.compilers - and self.os == "linux" - and (V(self.ctk_version) <= V("11.5")) - ): - deps += ( - "gcc_linux-64<=11.2", - "gxx_linux-64<=11.2", - ) - + if self.compilers and self.os == "linux": + # gcc 11.3 is incompatible with nvcc <= 11.5. + if V(self.ctk_version) <= V("11.5"): + deps += ( + "gcc_linux-64<=11.2", + "gxx_linux-64<=11.2", + ) + else: + deps += ( + "gcc_linux-64=11.*", + "gxx_linux-64=11.*", + ) return deps def __str__(self) -> str: