diff --git a/scripts/generate-conda-envs.py b/scripts/generate-conda-envs.py index 3791cfbee..9e82e3463 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: